From patchwork Wed Mar 6 20:43:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Syam Sidhardhan X-Patchwork-Id: 2228151 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 0AE83DF23A for ; Wed, 6 Mar 2013 20:44:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754910Ab3CFUoH (ORCPT ); Wed, 6 Mar 2013 15:44:07 -0500 Received: from mail-pb0-f45.google.com ([209.85.160.45]:58091 "EHLO mail-pb0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753852Ab3CFUoG (ORCPT ); Wed, 6 Mar 2013 15:44:06 -0500 Received: by mail-pb0-f45.google.com with SMTP id ro8so6522432pbb.18 for ; Wed, 06 Mar 2013 12:44:05 -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=ODM1gK05zA+8zqnyLRZjJtNnjZCOhOzxu4wbyOYFmoU=; b=PfmI4rpiKQQG/gUcN7jiE2B18tkVqfcpNcCdq0wJn8pZdD4suCSdzUlFaY5MWL/99m TPp9ookwOOZXuBRQtf+fQ4XiAXwvuT3w7t8FFjU4v96dSMVnrLfFdnEEMvkUFqI2V7iN GLslJD0NF56Eh9z6smfvRoQJfOfdyIMCfjjkFx1AD6Pf7Y6SHyrvKKgmuWST4wj+9YTn TrNcLLVIEWm93FCzJ7qZRvk7QiWRcPp2UYge/KMzuSllsq3PD/nLWa3C6arwdC7Lplr4 t4bHdjOXLwFyiKtNFfKeD7BxjytYvyp/cmhoPoRxQ8GIw9Czvpu66Ep4hCGWdZkD8GtT UsdA== X-Received: by 10.68.202.34 with SMTP id kf2mr48616891pbc.44.1362602645643; Wed, 06 Mar 2013 12:44:05 -0800 (PST) Received: from localhost.localdomain ([27.7.134.34]) by mx.google.com with ESMTPS id hp7sm32757175pbc.8.2013.03.06.12.44.02 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 06 Mar 2013 12:44:04 -0800 (PST) From: syamsidhardh@gmail.com To: linux-fbdev@vger.kernel.org Cc: syamsidhardh@gmail.com, FlorianSchandinat@gmx.de, spock@gentoo.org, Syam Sidhardhan Subject: [PATCH v1] video: uvesafb: Remove redundant NULL check before kfree Date: Thu, 7 Mar 2013 02:13:58 +0530 Message-Id: <1362602638-7163-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 From: Syam Sidhardhan kfree on NULL pointer is a no-op. Signed-off-by: Syam Sidhardhan --- v1 -> Corrected the from address. 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);