From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753522AbbBARnC (ORCPT ); Sun, 1 Feb 2015 12:43:02 -0500 Received: from mout.web.de ([212.227.17.11]:49409 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753405AbbBARm7 (ORCPT ); Sun, 1 Feb 2015 12:42:59 -0500 Message-ID: <54CE659D.5010607@users.sourceforge.net> Date: Sun, 01 Feb 2015 18:42:53 +0100 From: SF Markus Elfring User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Greg Kroah-Hartman , devel@driverdev.osuosl.org CC: LKML , kernel-janitors@vger.kernel.org, Julia Lawall Subject: [PATCH] staging: gdm72xx: Deletion of an unnecessary check before the function call "kfree" References: <5307CAA2.8060406@users.sourceforge.net> <530A086E.8010901@users.sourceforge.net> <530A72AA.3000601@users.sourceforge.net> <530B5FB6.6010207@users.sourceforge.net> <530C5E18.1020800@users.sourceforge.net> <530CD2C4.4050903@users.sourceforge.net> <530CF8FF.8080600@users.sourceforge.net> <530DD06F.4090703@users.sourceforge.net> <5317A59D.4@users.sourceforge.net> In-Reply-To: <5317A59D.4@users.sourceforge.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:OJp21DkRTroG7nRFwGp/IDbUUptr6pJscawMMGKQ7DohPxC0HAt N1Bvx8QmwFjPw560TDxtxEk8opW2foSKMh7fEqTAplXwg1hpHZmw5zAwG8yQMTBy+gfsRIV Hv1XNsm5f4aZFqKoV7CpwFJPC93HCM3m1+YZCxmg8nm3YePyQv+x7q6kqjltNJRIdPpKfGh lJPEQaIlFZP+6cw9Z4zbw== X-UI-Out-Filterresults: notjunk:1; Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Markus Elfring Date: Sun, 1 Feb 2015 18:28:33 +0100 The kfree() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/staging/gdm72xx/gdm_wimax.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/gdm72xx/gdm_wimax.c b/drivers/staging/gdm72xx/gdm_wimax.c index 9cab54b..ac901e6 100644 --- a/drivers/staging/gdm72xx/gdm_wimax.c +++ b/drivers/staging/gdm72xx/gdm_wimax.c @@ -362,7 +362,7 @@ static int gdm_wimax_close(struct net_device *dev) static void kdelete(void **buf) { - if (buf && *buf) { + if (buf) { kfree(*buf); *buf = NULL; } -- 2.2.2