Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262045AbVC1Rvp (ORCPT ); Mon, 28 Mar 2005 12:51:45 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261986AbVC1Rsg (ORCPT ); Mon, 28 Mar 2005 12:48:36 -0500 Received: from fep19.inet.fi ([194.251.242.244]:21151 "EHLO fep19.inet.fi") by vger.kernel.org with ESMTP id S261981AbVC1RmV (ORCPT ); Mon, 28 Mar 2005 12:42:21 -0500 Subject: [PATCH 8/9] isofs: remove redundant kfree checks from rock From: Pekka Enberg To: akpm@osdl.org Cc: linux-kernel@vger.kernel.org Content-Type: text/plain Message-Id: In-Reply-To: Date: Mon, 28 Mar 2005 20:42:20 +0300 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2279 Lines: 110 This patch removes redundant kfree() NULL checks from fs/isofs/rock.c. Signed-off-by: Pekka Enberg --- rock.c | 36 ++++++++++++------------------------ 1 files changed, 12 insertions(+), 24 deletions(-) Index: 2.6/fs/isofs/rock.c =================================================================== --- 2.6.orig/fs/isofs/rock.c 2005-03-28 18:24:50.000000000 +0300 +++ 2.6/fs/isofs/rock.c 2005-03-28 18:24:53.000000000 +0300 @@ -130,18 +130,15 @@ retnamlen += rr->len - 5; break; case SIG('R', 'E'): - if (buffer) - kfree(buffer); + kfree(buffer); return -1; default: break; } } } - if (buffer) { - kfree(buffer); - buffer = NULL; - } + kfree(buffer); + buffer = NULL; if (cont_extent) { int block, offset, offset1; struct buffer_head * pbh; @@ -168,12 +165,10 @@ } printk("Unable to read rock-ridge attributes\n"); } - if (buffer) - kfree(buffer); + kfree(buffer); return retnamlen; /* If 0, this file did not have a NM field */ out: - if (buffer) - kfree(buffer); + kfree(buffer); return 0; } @@ -426,10 +421,8 @@ } } } - if (buffer) { - kfree(buffer); - buffer = NULL; - } + kfree(buffer); + buffer = NULL; if (cont_extent) { int block, offset, offset1; struct buffer_head * pbh; @@ -457,8 +450,7 @@ printk("Unable to read rock-ridge attributes\n"); } out: - if (buffer) - kfree(buffer); + kfree(buffer); return 0; } @@ -625,10 +617,8 @@ break; } } - if (buffer) { - kfree(buffer); - buffer = NULL; - } + kfree(buffer); + buffer = NULL; if (cont_extent) { int block, offset, offset1; struct buffer_head * pbh; @@ -655,8 +645,7 @@ } printk("Unable to read rock-ridge attributes\n"); } - if (buffer) - kfree(buffer); + kfree(buffer); if (rpnt == link) goto fail; @@ -670,8 +659,7 @@ /* error exit from macro */ out: - if (buffer) - kfree(buffer); + kfree(buffer); goto fail; out_noread: printk("unable to read i-node block"); - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/