From patchwork Wed Mar 5 15:54:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wang yanqing X-Patchwork-Id: 3777191 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9A9D6BF540 for ; Wed, 5 Mar 2014 15:55:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8029820220 for ; Wed, 5 Mar 2014 15:55:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8A79A2020F for ; Wed, 5 Mar 2014 15:55:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753899AbaCEPzY (ORCPT ); Wed, 5 Mar 2014 10:55:24 -0500 Received: from mail-pa0-f46.google.com ([209.85.220.46]:44553 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753008AbaCEPzX (ORCPT ); Wed, 5 Mar 2014 10:55:23 -0500 Received: by mail-pa0-f46.google.com with SMTP id kp14so1270648pab.33 for ; Wed, 05 Mar 2014 07:55:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mail-followup-to:mime-version :content-type:content-disposition:user-agent; bh=MVkUMGfS59UkzhdZrLzvGqhKF9OFAsuIE/Vz4TQKJv4=; b=ugIeFyYFlVGQDH6mWczZ5bMHSdWjImy/kXEdHw80rpoL4td4fuMtSzM0p3hP8JtM9t HqmvmI7O8//am1InVTc3JzLlvsnJWCkpwaAFv1wZbazwCWOiG9ln9YtSJyhqsEHevmlo RqyBBIR2hm8TpLmsPNPHEYkhIXZzEU72KmGQEBZRouEBQwYKE851rkha2ICv1A7R6F+0 VjhAT310BjZ90DpYwCRyj7eFC088KR+2816yn7DG5La3d2oa70LJz7TH1tnMqljydjdp 5hkvRjF+17Fz51hLjHMXYa3e+ZJjXFI1/bjSAZo4B+bESu/YrT/bOq+CczQJTURqBSks ZPtQ== X-Received: by 10.68.248.7 with SMTP id yi7mr7884483pbc.31.1394034923136; Wed, 05 Mar 2014 07:55:23 -0800 (PST) Received: from udknight.localhost ([117.30.98.13]) by mx.google.com with ESMTPSA id ac5sm9766464pbc.37.2014.03.05.07.55.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 05 Mar 2014 07:55:22 -0800 (PST) Received: from udknight.localhost (udknight.localhost [127.0.0.1]) by udknight.localhost (8.14.4/8.14.4) with ESMTP id s25FsMpZ032150; Wed, 5 Mar 2014 23:54:27 +0800 Received: (from root@localhost) by udknight.localhost (8.14.4/8.14.4/Submit) id s25FsICx032149; Wed, 5 Mar 2014 23:54:18 +0800 Date: Wed, 5 Mar 2014 23:54:18 +0800 From: Wang YanQing 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 Message-ID: <20140305155418.GA32106@udknight> Mail-Followup-To: Wang YanQing , tomi.valkeinen@ti.com, plagnioj@jcrosoft.com, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, fengguang.wu@intel.com MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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); }