From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751524Ab1FMUZP (ORCPT ); Mon, 13 Jun 2011 16:25:15 -0400 Received: from swampdragon.chaosbits.net ([90.184.90.115]:23053 "EHLO swampdragon.chaosbits.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751099Ab1FMUZN (ORCPT ); Mon, 13 Jun 2011 16:25:13 -0400 Date: Mon, 13 Jun 2011 22:16:44 +0200 (CEST) From: Jesper Juhl To: linux-kernel@vger.kernel.org cc: linux-mtd@lists.infradead.org, David Woodhouse , trivial@kernel.org Subject: [PATCH/Trivial] jffs2: Avoid unneeded 'if' before kfree Message-ID: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org kfree() deals gracefully with NULL pointers, so it's pointless to test for one prior to calling it. This removes such a test from jffs2_scan_medium(). Signed-off-by: Jesper Juhl --- scan.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/jffs2/scan.c b/fs/jffs2/scan.c index 8d8cd34..28107ca 100644 --- a/fs/jffs2/scan.c +++ b/fs/jffs2/scan.c @@ -275,9 +275,7 @@ int jffs2_scan_medium(struct jffs2_sb_info *c) else c->mtd->unpoint(c->mtd, 0, c->mtd->size); #endif - if (s) - kfree(s); - + kfree(s); return ret; } -- Jesper Juhl http://www.chaosbits.net/ Don't top-post http://www.catb.org/jargon/html/T/top-post.html Plain text mails only, please. From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from swampdragon.chaosbits.net ([90.184.90.115]) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QWDhG-0004bq-Ag for linux-mtd@lists.infradead.org; Mon, 13 Jun 2011 20:25:19 +0000 Date: Mon, 13 Jun 2011 22:16:44 +0200 (CEST) From: Jesper Juhl To: linux-kernel@vger.kernel.org Subject: [PATCH/Trivial] jffs2: Avoid unneeded 'if' before kfree Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: trivial@kernel.org, David Woodhouse , linux-mtd@lists.infradead.org List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , kfree() deals gracefully with NULL pointers, so it's pointless to test for one prior to calling it. This removes such a test from jffs2_scan_medium(). Signed-off-by: Jesper Juhl --- scan.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/jffs2/scan.c b/fs/jffs2/scan.c index 8d8cd34..28107ca 100644 --- a/fs/jffs2/scan.c +++ b/fs/jffs2/scan.c @@ -275,9 +275,7 @@ int jffs2_scan_medium(struct jffs2_sb_info *c) else c->mtd->unpoint(c->mtd, 0, c->mtd->size); #endif - if (s) - kfree(s); - + kfree(s); return ret; } -- Jesper Juhl http://www.chaosbits.net/ Don't top-post http://www.catb.org/jargon/html/T/top-post.html Plain text mails only, please.