From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Ahmed S. Darwish" Subject: Re: [PATCH] can: kvaser_usb: Don't free packets when tight on URBs Date: Sat, 3 Jan 2015 16:34:42 +0200 Message-ID: <20150103143442.GA24998@Darwish.PC> References: <20141223154654.GB6460@vivalin-002> <20150101135913.6205ce0e@urahara> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mail-wi0-f175.google.com ([209.85.212.175]:47705 "EHLO mail-wi0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751025AbbACQfR (ORCPT ); Sat, 3 Jan 2015 11:35:17 -0500 Content-Disposition: inline In-Reply-To: <20150101135913.6205ce0e@urahara> Sender: linux-can-owner@vger.kernel.org List-ID: To: Stephen Hemminger Cc: Olivier Sobrie , Oliver Hartkopp , Wolfgang Grandegger , Marc Kleine-Budde , "David S. Miller" , Paul Gortmaker , Linux-CAN , netdev , LKML On Thu, Jan 01, 2015 at 01:59:13PM -0800, Stephen Hemminger wrote: > On Tue, 23 Dec 2014 17:46:54 +0200 > "Ahmed S. Darwish" wrote: > > > int ret = NETDEV_TX_OK; > > + bool kfree_skb_on_error = true; > > > > if (can_dropped_invalid_skb(netdev, skb)) > > return NETDEV_TX_OK; > > @@ -1336,6 +1337,7 @@ static netdev_tx_t kvaser_usb_start_xmit(struct sk_buff *skb, > > > > if (!context) { > > netdev_warn(netdev, "cannot find free context\n"); > > + kfree_skb_on_error = false; > > ret = NETDEV_TX_BUSY; > > You already have a flag value (ret == NETDEV_TX_BUSY), why > not use that instead of introducing another variable? Yes, that variable got implicitly removed in v2 patch 1/4. Thanks, -- Darwish