From: Alex Deucher Date: Fri, 27 Sep 2013 22:44:39 +0000 (-0400) Subject: drm/edid: catch kmalloc failure in drm_edid_to_speaker_allocation X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=aaed41ec5b8d734f79d7b87723190256ac6a0926;p=linux-beck.git drm/edid: catch kmalloc failure in drm_edid_to_speaker_allocation Return -ENOMEM if the allocation fails. Signed-off-by: Alex Deucher Reviewed-by: Jani Nikula --- diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 1688ff500513..830f7501cb4d 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;