drm/edid: catch kmalloc failure in drm_edid_to_speaker_allocation
Subsystems (2)
PATCH 1/1 drm/edid: catch kmalloc failure in drm_edid_to_speaker_allocation
Return -ENOMEM if the allocation fails.
Signed-off-by Alex Deucher <[email protected]>
--- drivers/gpu/drm/drm_edid.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/drm_edid.c +2 -0
@@ -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 ;
Signature · 1 line
1.8.3.1
Quoted 3 lines · Alex Deucher
Return
-ENOMEMif the allocation fails.Signed-off-by Alex Deucher <[email protected]>
Reviewed-by Jani Nikula <[email protected]>
Quoted 24 lines
--- drivers/gpu/drm/drm_edid.c | 2 ++ 1 file changed, 2 insertions(+)drivers/gpu/drm/drm_edid.c +2
-0@@ -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 ;Signature · 6 lines
1.8.3.1 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel