All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: Wang YanQing <udknight@gmail.com>
Cc: plagnioj@jcrosoft.com, linux-fbdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, fengguang.wu@intel.com
Subject: Re: [PATCH] video: fbdev: uvesafb: Remove redundant NULL check in uvesafb_remove
Date: Thu, 06 Mar 2014 09:31:55 +0000	[thread overview]
Message-ID: <5318408B.5060008@ti.com> (raw)
In-Reply-To: <20140305155418.GA32106@udknight>

[-- Attachment #1: Type: text/plain, Size: 1231 bytes --]

On 05/03/14 17:54, Wang YanQing wrote:
> Because uvesafb_par is allocated as part of fb_info in uvesafb_probe,
> so we don't need to do NULL check for both fb_info and uvesafb_par in
> uvesafb_remove.
> 
> [ This patch also fix a warning report by fengguang.wu@intel.com
>   "drivers/video/fbdev/uvesafb.c:1815 uvesafb_remove()
>    warn: variable dereferenced before check 'par'" ]
> 
> Signed-off-by: Wang YanQing <udknight@gmail.com>
> ---
>  drivers/video/fbdev/uvesafb.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/video/fbdev/uvesafb.c b/drivers/video/fbdev/uvesafb.c
> index 1f38445..18352b2 100644
> --- a/drivers/video/fbdev/uvesafb.c
> +++ b/drivers/video/fbdev/uvesafb.c
> @@ -1812,11 +1812,9 @@ static int uvesafb_remove(struct platform_device *dev)
>  		fb_destroy_modedb(info->monspecs.modedb);
>  		fb_dealloc_cmap(&info->cmap);
>  
> -		if (par) {
> -			kfree(par->vbe_modes);
> -			kfree(par->vbe_state_orig);
> -			kfree(par->vbe_state_saved);
> -		}
> +		kfree(par->vbe_modes);
> +		kfree(par->vbe_state_orig);
> +		kfree(par->vbe_state_saved);
>  
>  		framebuffer_release(info);
>  	}
> 

Thanks, queuing for 3.15.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: Wang YanQing <udknight@gmail.com>
Cc: <plagnioj@jcrosoft.com>, <linux-fbdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <fengguang.wu@intel.com>
Subject: Re: [PATCH] video: fbdev: uvesafb: Remove redundant NULL check in uvesafb_remove
Date: Thu, 6 Mar 2014 11:31:55 +0200	[thread overview]
Message-ID: <5318408B.5060008@ti.com> (raw)
In-Reply-To: <20140305155418.GA32106@udknight>

[-- Attachment #1: Type: text/plain, Size: 1231 bytes --]

On 05/03/14 17:54, Wang YanQing wrote:
> Because uvesafb_par is allocated as part of fb_info in uvesafb_probe,
> so we don't need to do NULL check for both fb_info and uvesafb_par in
> uvesafb_remove.
> 
> [ This patch also fix a warning report by fengguang.wu@intel.com
>   "drivers/video/fbdev/uvesafb.c:1815 uvesafb_remove()
>    warn: variable dereferenced before check 'par'" ]
> 
> Signed-off-by: Wang YanQing <udknight@gmail.com>
> ---
>  drivers/video/fbdev/uvesafb.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/video/fbdev/uvesafb.c b/drivers/video/fbdev/uvesafb.c
> index 1f38445..18352b2 100644
> --- a/drivers/video/fbdev/uvesafb.c
> +++ b/drivers/video/fbdev/uvesafb.c
> @@ -1812,11 +1812,9 @@ static int uvesafb_remove(struct platform_device *dev)
>  		fb_destroy_modedb(info->monspecs.modedb);
>  		fb_dealloc_cmap(&info->cmap);
>  
> -		if (par) {
> -			kfree(par->vbe_modes);
> -			kfree(par->vbe_state_orig);
> -			kfree(par->vbe_state_saved);
> -		}
> +		kfree(par->vbe_modes);
> +		kfree(par->vbe_state_orig);
> +		kfree(par->vbe_state_saved);
>  
>  		framebuffer_release(info);
>  	}
> 

Thanks, queuing for 3.15.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]

  reply	other threads:[~2014-03-06  9:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-05 15:54 [PATCH] video: fbdev: uvesafb: Remove redundant NULL check in uvesafb_remove Wang YanQing
2014-03-05 15:54 ` Wang YanQing
2014-03-06  9:31 ` Tomi Valkeinen [this message]
2014-03-06  9:31   ` Tomi Valkeinen

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=5318408B.5060008@ti.com \
    --to=tomi.valkeinen@ti.com \
    --cc=fengguang.wu@intel.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=plagnioj@jcrosoft.com \
    --cc=udknight@gmail.com \
    /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.