Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261928AbVDKUwL (ORCPT ); Mon, 11 Apr 2005 16:52:11 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261929AbVDKUwK (ORCPT ); Mon, 11 Apr 2005 16:52:10 -0400 Received: from mail.dif.dk ([193.138.115.101]:22729 "EHLO saerimmer.dif.dk") by vger.kernel.org with ESMTP id S261928AbVDKUvo (ORCPT ); Mon, 11 Apr 2005 16:51:44 -0400 Date: Mon, 11 Apr 2005 22:54:25 +0200 (CEST) From: Jesper Juhl To: Matthew Wilcox , Grant Grundler Cc: parisc-linux@parisc-linux.org, linux-kernel@vger.kernel.org Subject: [PATCH] parisc: kfree cleanup in arch/parisc/ Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2088 Lines: 96 Get rid of redundant NULL pointer checks before kfree() in arch/parisc/ as well as a few blank lines. Signed-off-by: Jesper Juhl diff -upr linux-2.6.12-rc2-mm3-orig/arch/parisc/kernel/ioctl32.c linux-2.6.12-rc2-mm3/arch/parisc/kernel/ioctl32.c --- linux-2.6.12-rc2-mm3-orig/arch/parisc/kernel/ioctl32.c 2005-04-05 21:21:08.000000000 +0200 +++ linux-2.6.12-rc2-mm3/arch/parisc/kernel/ioctl32.c 2005-04-11 22:48:03.000000000 +0200 @@ -104,12 +104,9 @@ static int drm32_version(unsigned int fd } out: - if (kversion.name) - kfree(kversion.name); - if (kversion.date) - kfree(kversion.date); - if (kversion.desc) - kfree(kversion.desc); + kfree(kversion.name); + kfree(kversion.date); + kfree(kversion.desc); return ret; } @@ -166,9 +163,7 @@ static int drm32_getsetunique(unsigned i ret = -EFAULT; } - if (karg.unique != NULL) - kfree(karg.unique); - + kfree(karg.unique); return ret; } @@ -265,7 +260,6 @@ static int drm32_info_bufs(unsigned int } kfree(karg.list); - return ret; } @@ -305,7 +299,6 @@ static int drm32_free_bufs(unsigned int out: kfree(karg.list); - return ret; } @@ -494,15 +487,10 @@ static int drm32_dma(unsigned int fd, un } out: - if (karg.send_indices) - kfree(karg.send_indices); - if (karg.send_sizes) - kfree(karg.send_sizes); - if (karg.request_indices) - kfree(karg.request_indices); - if (karg.request_sizes) - kfree(karg.request_sizes); - + kfree(karg.send_indices); + kfree(karg.send_sizes); + kfree(karg.request_indices); + kfree(karg.request_sizes); return ret; } @@ -555,9 +543,7 @@ static int drm32_res_ctx(unsigned int fd ret = -EFAULT; } - if (karg.contexts) - kfree(karg.contexts); - + kfree(karg.contexts); return ret; } PS. If you reply to lists other than Linux-kernel, then please keep me on CC: - 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/