linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] video: fbdev: uvesafb: Remove redundant NULL check in uvesafb_remove
@ 2014-03-05 15:54 Wang YanQing
  2014-03-06  9:31 ` Tomi Valkeinen
  0 siblings, 1 reply; 2+ messages in thread
From: Wang YanQing @ 2014-03-05 15:54 UTC (permalink / raw)
  To: tomi.valkeinen; +Cc: plagnioj, linux-fbdev, linux-kernel, fengguang.wu

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);
 	}
-- 
1.8.3.4.8.g69490f3.dirty

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

* Re: [PATCH] video: fbdev: uvesafb: Remove redundant NULL check in uvesafb_remove
  2014-03-05 15:54 [PATCH] video: fbdev: uvesafb: Remove redundant NULL check in uvesafb_remove Wang YanQing
@ 2014-03-06  9:31 ` Tomi Valkeinen
  0 siblings, 0 replies; 2+ messages in thread
From: Tomi Valkeinen @ 2014-03-06  9:31 UTC (permalink / raw)
  To: Wang YanQing; +Cc: plagnioj, linux-fbdev, linux-kernel, fengguang.wu

[-- 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 --]

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

end of thread, other threads:[~2014-03-06  9:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-05 15:54 [PATCH] video: fbdev: uvesafb: Remove redundant NULL check in uvesafb_remove Wang YanQing
2014-03-06  9:31 ` Tomi Valkeinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).