1
0
Fork 0

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>
hifive-unleashed-5.1
Alex Deucher 2013-09-27 18:46:09 -04:00 committed by Dave Airlie
parent 0aec288130
commit 618e377608
1 changed files with 2 additions and 0 deletions

View File

@ -2937,6 +2937,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;