From patchwork Wed Sep 25 11:29:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 2941871 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 377C69F2B8 for ; Wed, 25 Sep 2013 11:30:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 14A9C20547 for ; Wed, 25 Sep 2013 11:30:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CE46B203E8 for ; Wed, 25 Sep 2013 11:30:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755250Ab3IYLaL (ORCPT ); Wed, 25 Sep 2013 07:30:11 -0400 Received: from mail-pb0-f41.google.com ([209.85.160.41]:53733 "EHLO mail-pb0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755040Ab3IYLaK (ORCPT ); Wed, 25 Sep 2013 07:30:10 -0400 Received: by mail-pb0-f41.google.com with SMTP id rp2so5929539pbb.0 for ; Wed, 25 Sep 2013 04:30:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Dgh/UaY3GuAPgm7CoTE/QtX8tHznZDb87rEPEqJ2rqw=; b=ltwdmM9iQDSmeCC6P6fNA6YAcRIm5Zd8EyOpuaYQ/FI3Ej85gp8R6wpeVw8rEB3zD0 bB3RlcaJWflT4ktAJKoMnUF4CtOMdX1Fh3eG1cRdwuHtFdVhCjZntaDAN+zR7voBJbfh 91uvD4WpHnUTa2u9WKlN4R+Bp+oq1r252UcTrKoRAnsQ9AH9TCh+LkdRP7MjWB7Dwwm/ seFkWhs55dOloXDyvtWGw7D8Ez2+aLbDOCPVuTdkTiOoOuAIEHSTaZQcmGoKiujrw55K 8yLVlE1+rjUdHJGSw96ptQSJyduuVJiJHA2vA5MabzbMZtG6pWcEkwLNwHfF8uOqdVdV mjcQ== X-Gm-Message-State: ALoCoQl8qAZV3X9920qOBkAXN+rrerI2GF02yajqElMdBS4z+oJKuov/9zLP7YCuxZqyEF7Gaqc3 X-Received: by 10.68.48.166 with SMTP id m6mr32300671pbn.105.1380108610361; Wed, 25 Sep 2013 04:30:10 -0700 (PDT) Received: from linaro.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPSA id fy4sm47095730pbb.1.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 25 Sep 2013 04:30:09 -0700 (PDT) From: Sachin Kamat To: linux-fbdev@vger.kernel.org Cc: plagnioj@jcrosoft.com, tomi.valkeinen@ti.com, sachin.kamat@linaro.org, Michal Januszewski Subject: [PATCH 6/6] video: uvesafb: Remove redundant NULL check Date: Wed, 25 Sep 2013 16:59:54 +0530 Message-Id: <1380108594-19090-6-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1380108594-19090-1-git-send-email-sachin.kamat@linaro.org> References: <1380108594-19090-1-git-send-email-sachin.kamat@linaro.org> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-8.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 kfree on a NULL pointer is a no-op. Signed-off-by: Sachin Kamat Cc: Michal Januszewski --- drivers/video/uvesafb.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c index 7aec6f3..676a4b9 100644 --- a/drivers/video/uvesafb.c +++ b/drivers/video/uvesafb.c @@ -233,8 +233,7 @@ out: static void uvesafb_free(struct uvesafb_ktask *task) { if (task) { - if (task->done) - kfree(task->done); + kfree(task->done); kfree(task); } } @@ -1332,8 +1331,8 @@ setmode: FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_TRUECOLOR; info->fix.line_length = mode->bytes_per_scan_line; -out: if (crtc != NULL) - kfree(crtc); +out: + kfree(crtc); uvesafb_free(task); return err; @@ -1793,8 +1792,7 @@ out_mode: fb_destroy_modedb(info->monspecs.modedb); fb_dealloc_cmap(&info->cmap); out: - if (par->vbe_modes) - kfree(par->vbe_modes); + kfree(par->vbe_modes); framebuffer_release(info); return err; @@ -1817,12 +1815,9 @@ static int uvesafb_remove(struct platform_device *dev) fb_dealloc_cmap(&info->cmap); if (par) { - if (par->vbe_modes) - kfree(par->vbe_modes); - if (par->vbe_state_orig) - kfree(par->vbe_state_orig); - if (par->vbe_state_saved) - kfree(par->vbe_state_saved); + kfree(par->vbe_modes); + kfree(par->vbe_state_orig); + kfree(par->vbe_state_saved); } framebuffer_release(info);