dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Alex Deucher <alexdeucher@gmail.com>, dri-devel@lists.freedesktop.org
Cc: Alex Deucher <alexander.deucher@amd.com>
Subject: Re: [PATCH] drm/edid: catch kmalloc failure in drm_edid_to_speaker_allocation
Date: Mon, 30 Sep 2013 08:36:42 +0300	[thread overview]
Message-ID: <87ioxi3m6t.fsf@intel.com> (raw)
In-Reply-To: <1380321969-16078-1-git-send-email-alexander.deucher@amd.com>

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

      reply	other threads:[~2013-09-30  5:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ioxi3m6t.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=alexander.deucher@amd.com \
    --cc=alexdeucher@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox