linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wang YanQing <udknight@gmail.com>
To: tomi.valkeinen@ti.com
Cc: plagnioj@jcrosoft.com, linux-fbdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, fengguang.wu@intel.com
Subject: [PATCH] video: fbdev: uvesafb: Remove redundant NULL check in uvesafb_remove
Date: Wed, 05 Mar 2014 15:54:18 +0000	[thread overview]
Message-ID: <20140305155418.GA32106@udknight> (raw)

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

             reply	other threads:[~2014-03-05 15:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-05 15:54 Wang YanQing [this message]
2014-03-06  9:31 ` [PATCH] video: fbdev: uvesafb: Remove redundant NULL check in uvesafb_remove 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=20140305155418.GA32106@udknight \
    --to=udknight@gmail.com \
    --cc=fengguang.wu@intel.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=plagnioj@jcrosoft.com \
    --cc=tomi.valkeinen@ti.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 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).