All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/edid: catch kmalloc failure in drm_edid_to_speaker_allocation
@ 2013-09-27 22:46 Alex Deucher
  2013-09-30  5:36 ` Jani Nikula
  0 siblings, 1 reply; 2+ messages in thread
From: Alex Deucher @ 2013-09-27 22:46 UTC (permalink / raw)
  To: dri-devel; +Cc: Alex Deucher

Return -ENOMEM if the allocation fails.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/drm_edid.c | 2 ++
 1 file changed, 2 insertions(+)

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;
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-09-30  5:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-27 22:46 [PATCH] drm/edid: catch kmalloc failure in drm_edid_to_speaker_allocation Alex Deucher
2013-09-30  5:36 ` Jani Nikula

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.