Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1228505pxb; Fri, 21 Jan 2022 12:49:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJw6+4NPdvtFbotneBPSuDYTcNeGnuXI1VuLNt65oQdfPR/Ewv1aC7NyR2qEUlfL9zrVXX8t X-Received: by 2002:a63:9549:: with SMTP id t9mr4135705pgn.107.1642798164527; Fri, 21 Jan 2022 12:49:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642798164; cv=none; d=google.com; s=arc-20160816; b=AkK32jgUwWXiCR5mTN3x4OJIW+09aMJTlp4M6AA+tENNF6s7ftpMi3qOlR9Jgt4pI5 n7UlEEuz5Z97MU0m9lUsjI3veZov0No0hcwSM1TjaWO0uU/E/fFtGkQzhyTib47T+HNn CUpkKuIAZR1CLAHWaF7hMKepYoD4DSBc5xHsrPj+RuUrsVTRzBxfdnbfK3vk/cHrqRIT UuR6wk8u4VRMnZQHOnb1c4w1YVvzGx7vxafDNTrOOvmlUqTUFLQfXRlJoBJqz10nurSt GrHKDVl6+da6GiNmF7gcYzivsit0O16FmTaM6/w7NxQS8DmkbicEpLqOepKMtB5I4C5I z4/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=msTMfEwb5LVGYaOW3GqyTs/RF9J/6bNmrug5c6ZX/Y4=; b=chGk4nXZEX3Xj4Ok+Al/HmrxvrT7mSz4dc+QH8XqHCwuM1lcJWKx5hLpx/thTJf6bf FHaRD/K/u1Dlf/7wF9LHy5wDbJOzxs2v/I2Mog/6y0tm3cLSldrrhmE54IFgnWSTlTt9 Dn9PY1aJLcLoEZP3qLv5uXY70Gomwgk5HyyYrCVqeIGT8qtKd4igaIagkCo6uqWo6Ill grEll4Zncc8FQEG1kAUFx0rSYZU9UnmSm3LVbTkFcEy8T+SDg6mD9CqaxVe8mX5uZ2G2 X+C6TEm06UM0r9irEVRDUJ/7BJ9kg4HT13Odt3l8AGIzwrvk4NI/9hh9loQc250yZqeK jFTQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b26si2988255pfo.306.2022.01.21.12.49.15; Fri, 21 Jan 2022 12:49:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357875AbiATAhA (ORCPT + 70 others); Wed, 19 Jan 2022 19:37:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357868AbiATAg7 (ORCPT ); Wed, 19 Jan 2022 19:36:59 -0500 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::226]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C35BC06173F; Wed, 19 Jan 2022 16:36:58 -0800 (PST) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 551A2C000A; Thu, 20 Jan 2022 00:36:55 +0000 (UTC) From: Miquel Raynal To: Alexander Aring , Stefan Schmidt , linux-wpan@vger.kernel.org Cc: "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org, linux-wireless@vger.kernel.org, Xue Liu , Marcel Holtmann , Harry Morris , David Girault , Romuald Despres , Frederic Blain , Nicolas Schodet , Thomas Petazzoni , Miquel Raynal Subject: [wpan-next 5/9] net: ieee802154: ca8210: Stop leaking skb's Date: Thu, 20 Jan 2022 01:36:41 +0100 Message-Id: <20220120003645.308498-6-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220120003645.308498-1-miquel.raynal@bootlin.com> References: <20220120003645.308498-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Upon error the ieee802154_xmit_complete() helper is not called. Only ieee802154_wake_queue() is called manually. We then leak the skb structure. Free the skb structure upon error before returning. Fixes: ded845a781a5 ("ieee802154: Add CA8210 IEEE 802.15.4 device driver") Signed-off-by: Miquel Raynal --- drivers/net/ieee802154/ca8210.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ieee802154/ca8210.c b/drivers/net/ieee802154/ca8210.c index ece6ff6049f6..5d1b356cb9d3 100644 --- a/drivers/net/ieee802154/ca8210.c +++ b/drivers/net/ieee802154/ca8210.c @@ -1772,6 +1772,7 @@ static int ca8210_async_xmit_complete( ); if (status != MAC_TRANSACTION_OVERFLOW) { ieee802154_wake_queue(priv->hw); + dev_kfree_skb_any(atusb->tx_skb); return 0; } } -- 2.27.0