aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_edid.c
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2013-09-27 18:46:09 -0400
committerDave Airlie <airlied@redhat.com>2013-10-01 01:28:57 -0400
commit618e377608c046a696ad78fb3015db0c17719f3a (patch)
tree4759109414a27e920b91609a8ad501faa5f5b26f /drivers/gpu/drm/drm_edid.c
parent0aec288130713cf7bcf97c929ac5fab6a8e00e44 (diff)
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> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/drm_edid.c')
-rw-r--r--drivers/gpu/drm/drm_edid.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 3140a30aa818..9173be34b4c2 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -2937,6 +2937,8 @@ int drm_edid_to_speaker_allocation(struct edid *edid, u8 **sadb)
2937 /* Speaker Allocation Data Block */ 2937 /* Speaker Allocation Data Block */
2938 if (dbl == 3) { 2938 if (dbl == 3) {
2939 *sadb = kmalloc(dbl, GFP_KERNEL); 2939 *sadb = kmalloc(dbl, GFP_KERNEL);
2940 if (!*sadb)
2941 return -ENOMEM;
2940 memcpy(*sadb, &db[1], dbl); 2942 memcpy(*sadb, &db[1], dbl);
2941 count = dbl; 2943 count = dbl;
2942 break; 2944 break;