diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2013-09-27 22:44:39 (GMT) |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2013-10-09 21:13:43 (GMT) |
commit | aaed41ec5b8d734f79d7b87723190256ac6a0926 (patch) | |
tree | 86a914728a6f2cb5195a033475edbf8307ef2b8f /drivers/gpu/drm | |
parent | 1d083bc93d159ebcb46c5cbeca512ddd74a74e4b (diff) | |
download | linux-fsl-qoriq-aaed41ec5b8d734f79d7b87723190256ac6a0926.tar.xz |
drm/edid: catch kmalloc failure in drm_edid_to_speaker_allocation
Return -ENOMEM if the allocation fails.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/drm_edid.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 1688ff5..830f750 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -2925,6 +2925,8 @@ int drm_edid_to_speaker_allocation(struct edid *edid, u8 **sadb) /* Speaker Allocation Data Block */ if (dbl == 3) { *sadb = kmalloc(dbl, GFP_KERNEL); + if (!*sadb) + return -ENOMEM; memcpy(*sadb, &db[1], dbl); count = dbl; break; |