From patchwork Thu May 12 14:33:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 12847774 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 76DD4C433F5 for ; Thu, 12 May 2022 14:33:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355341AbiELOdc (ORCPT ); Thu, 12 May 2022 10:33:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355323AbiELOd1 (ORCPT ); Thu, 12 May 2022 10:33:27 -0400 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D373725F78E; Thu, 12 May 2022 07:33:24 -0700 (PDT) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id CA4E3FF813; Thu, 12 May 2022 14:33:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1652366003; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Q7eQ2QxN67uBMocQZANqKQDKfsx58Be6cxD8wB3BLfw=; b=k/i8K9HvT1PmX+7wbDBNKK1tFvM4iwma5ZexBhI5ud/x84YyH2NvBPbhK5qVtA8o1QNdwv QJZ//zZNC++waNAPaOBhL6smM5D440HcgSMZG7veUuvylRG+K6k6XQ+SNaFvwPjG2N1n18 6WwqdtssdaNpCTEvRuxAWbyQSKn7iI10kN+0Mp8HDSYNx5ZX6GadbKCGh+hgpEI9Qqdx3E zDdojXpbYczZMno1rwqntPrVyuqlU9Y4wo5SewwP89SOSWfYAjVtFDVGqBNMyoRH5xWwC6 HjsMHrVI3Eo/OCEZEnglXjukS5OiAMcRYO10OhF/Ba6oXKhMmbWn5aVL3hkchQ== From: Miquel Raynal To: Alexander Aring , Stefan Schmidt , linux-wpan@vger.kernel.org Cc: "David S. Miller" , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, David Girault , Romuald Despres , Frederic Blain , Nicolas Schodet , Thomas Petazzoni , Miquel Raynal Subject: [PATCH wpan-next v2 03/11] net: mac802154: Enhance the error path in the main tx helper Date: Thu, 12 May 2022 16:33:06 +0200 Message-Id: <20220512143314.235604-4-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220512143314.235604-1-miquel.raynal@bootlin.com> References: <20220512143314.235604-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Before adding more logic in the error path, let's move the wake queue call there, rename the default label and create an additional one. There is no functional change. Signed-off-by: Miquel Raynal --- net/mac802154/tx.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/net/mac802154/tx.c b/net/mac802154/tx.c index a01689ddd547..4a46ce8d2ac8 100644 --- a/net/mac802154/tx.c +++ b/net/mac802154/tx.c @@ -65,7 +65,7 @@ ieee802154_tx(struct ieee802154_local *local, struct sk_buff *skb) consume_skb(skb); skb = nskb; } else { - goto err_tx; + goto err_free_skb; } } @@ -84,10 +84,8 @@ ieee802154_tx(struct ieee802154_local *local, struct sk_buff *skb) unsigned int len = skb->len; ret = drv_xmit_async(local, skb); - if (ret) { - ieee802154_wake_queue(&local->hw); - goto err_tx; - } + if (ret) + goto err_wake_netif_queue; dev->stats.tx_packets++; dev->stats.tx_bytes += len; @@ -98,7 +96,9 @@ ieee802154_tx(struct ieee802154_local *local, struct sk_buff *skb) return NETDEV_TX_OK; -err_tx: +err_wake_netif_queue: + ieee802154_wake_queue(&local->hw); +err_free_skb: kfree_skb(skb); return NETDEV_TX_OK; }