All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
To: linux-fbdev@vger.kernel.org
Subject: Re: [patch] viafb: NULL dereference on allocation failure in query_edid()
Date: Fri, 17 Feb 2012 07:30:07 +0000	[thread overview]
Message-ID: <4F3E01FF.4040003@gmx.de> (raw)
In-Reply-To: <20120217064501.GD3666@elgon.mountain>

On 02/17/2012 06:45 AM, Dan Carpenter wrote:
> We should handle the allocation here, if only to keep the static
> checkers happy.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Ah, thanks for noticing it and sorry that I introduced it in the first place.
Applied.


Thanks,

Florian Tobias Schandinat

> 
> diff --git a/drivers/video/via/via_aux_edid.c b/drivers/video/via/via_aux_edid.c
> index 03f7a41..754d450 100644
> --- a/drivers/video/via/via_aux_edid.c
> +++ b/drivers/video/via/via_aux_edid.c
> @@ -36,10 +36,13 @@ static void query_edid(struct via_aux_drv *drv)
>  	unsigned char edid[EDID_LENGTH];
>  	bool valid = false;
>  
> -	if (spec)
> +	if (spec) {
>  		fb_destroy_modedb(spec->modedb);
> -	else
> +	} else {
>  		spec = kmalloc(sizeof(*spec), GFP_KERNEL);
> +		if (!spec)
> +			return;
> +	}
>  
>  	spec->version = spec->revision = 0;
>  	if (via_aux_read(drv, 0x00, edid, EDID_LENGTH)) {
> 


      reply	other threads:[~2012-02-17  7:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-17  6:45 [patch] viafb: NULL dereference on allocation failure in query_edid() Dan Carpenter
2012-02-17  7:30 ` Florian Tobias Schandinat [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=4F3E01FF.4040003@gmx.de \
    --to=florianschandinat@gmx.de \
    --cc=linux-fbdev@vger.kernel.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 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.