From patchwork Tue Mar 5 19:38:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Syam Sidhardhan X-Patchwork-Id: 2221301 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id DD2953FCF2 for ; Tue, 5 Mar 2013 19:38:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751244Ab3CETit (ORCPT ); Tue, 5 Mar 2013 14:38:49 -0500 Received: from mail-pb0-f47.google.com ([209.85.160.47]:60805 "EHLO mail-pb0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750755Ab3CETis (ORCPT ); Tue, 5 Mar 2013 14:38:48 -0500 Received: by mail-pb0-f47.google.com with SMTP id rp2so4873901pbb.6 for ; Tue, 05 Mar 2013 11:38:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=Cc/4zxjPcBWJ3/GoxUrs/5gS1skrF0lvATkFVO2uoDo=; b=SoYjRRSNO9LweQbCM7WNyFfrCcQQ5MowFi7V6nGjz/jD52TlCUw4Et0/bFWpR3fvSs z3K8ihXLSf33k/HcAMVSVe3vOaztMDWFTJ1z3Y5+koFGAEvk/QN1VtzcU1x9HMHlVu+C 2B/Thf+x1oIWmFRwVpfbi/LcBfOEaMoYB3CHLWatgBOUGmqrj7KDZuZhBXDuwjhrHlTK pKkt7/l34r2QqRXPfApqPvS0VMfPewrnzmfMbyB9NaD249IeLYySD4EsgYn62Efjm37v Am3rsNgfVzR65FSyHqSAxpH2n4qaIKNXmC7dJ0obL4yw7FkNMVOYowo10grByTYMyR6x oYRg== X-Received: by 10.68.10.227 with SMTP id l3mr40188947pbb.100.1362512328467; Tue, 05 Mar 2013 11:38:48 -0800 (PST) Received: from localhost.localdomain ([27.7.134.34]) by mx.google.com with ESMTPS id ri1sm27902311pbc.16.2013.03.05.11.38.44 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 05 Mar 2013 11:38:47 -0800 (PST) From: Syam Sidhardhan To: linux-fbdev@vger.kernel.org Cc: syamsidhardh@gmail.com, FlorianSchandinat@gmx.de, spock@gentoo.org Subject: [PATCH] video: uvesafb: Remove redundant NULL check before kfree Date: Wed, 6 Mar 2013 01:08:37 +0530 Message-Id: <1362512317-3880-1-git-send-email-s.syam@samsung.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org kfree on NULL pointer is a no-op. Signed-off-by: Syam Sidhardhan --- 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 b75db01..7ac0ce6 100644 --- a/drivers/video/uvesafb.c +++ b/drivers/video/uvesafb.c @@ -236,8 +236,7 @@ out: static void uvesafb_free(struct uvesafb_ktask *task) { if (task) { - if (task->done) - kfree(task->done); + kfree(task->done); kfree(task); } } @@ -1335,8 +1334,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; @@ -1833,8 +1832,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; @@ -1856,12 +1854,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);