Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753414AbbKPNqu (ORCPT ); Mon, 16 Nov 2015 08:46:50 -0500 Received: from lists.s-osg.org ([54.187.51.154]:55890 "EHLO lists.s-osg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753071AbbKPNqo (ORCPT ); Mon, 16 Nov 2015 08:46:44 -0500 Subject: Re: [PATCH] ieee802154-atusb: Delete an unnecessary check before the function call "kfree_skb" To: SF Markus Elfring , Alexander Aring , linux-wpan@vger.kernel.org, netdev@vger.kernel.org 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> <5649D2AE.60100@users.sourceforge.net> Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall From: Stefan Schmidt Message-ID: <5649DE40.6030405@osg.samsung.com> Date: Mon, 16 Nov 2015 14:46:40 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <5649D2AE.60100@users.sourceforge.net> Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1302 Lines: 40 Hello. On 16/11/15 13:57, SF Markus Elfring wrote: > From: Markus Elfring > Date: Mon, 16 Nov 2015 13:50:23 +0100 > > The kfree_skb() 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/net/ieee802154/atusb.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/net/ieee802154/atusb.c b/drivers/net/ieee802154/atusb.c > index 199a94a..b1cd865 100644 > --- a/drivers/net/ieee802154/atusb.c > +++ b/drivers/net/ieee802154/atusb.c > @@ -310,8 +310,7 @@ static void atusb_free_urbs(struct atusb *atusb) > urb = usb_get_from_anchor(&atusb->idle_urbs); > if (!urb) > break; > - if (urb->context) > - kfree_skb(urb->context); > + kfree_skb(urb->context); > usb_free_urb(urb); > } > } Acked-by: Stefan Schmidt regards Stefan Schmidt -- 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/