* [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* Re: [PATCH] drm/edid: catch kmalloc failure in drm_edid_to_speaker_allocation
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
0 siblings, 0 replies; 2+ messages in thread
From: Jani Nikula @ 2013-09-30 5:36 UTC (permalink / raw)
To: Alex Deucher, dri-devel; +Cc: Alex Deucher
On Sat, 28 Sep 2013, Alex Deucher <alexdeucher@gmail.com> wrote:
> Return -ENOMEM if the allocation fails.
>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.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
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [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.