From mboxrd@z Thu Jan 1 00:00:00 1970 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 D8A2AC433FE for ; Mon, 7 Feb 2022 11:26:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1383291AbiBGLWB (ORCPT ); Mon, 7 Feb 2022 06:22:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381708AbiBGLR3 (ORCPT ); Mon, 7 Feb 2022 06:17:29 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2F4DC03FEE9; Mon, 7 Feb 2022 03:17:08 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 851C26113B; Mon, 7 Feb 2022 11:17:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6BC8DC004E1; Mon, 7 Feb 2022 11:17:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644232628; bh=KihTurCynR+zU2kUyr36ZMXFVU4sPftbTicBV9rTdJA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ufCJSmXgGRZHMcwraisok2U5NNFCJB8oUDvlvvwThfbwh6oGkzD8L/xtwGUNG/tLk qFfbSsJb2kZkMKTdpAV1X7r2JmppetAFCo19o9lGscUOh3IzIdPgawRQ/NagKs9FHT zuKgASINGTuKs0x0x/vgufDC+NBa55AyeqO3kJIU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miquel Raynal , Alexander Aring , Stefan Schmidt Subject: [PATCH 4.19 72/86] net: ieee802154: ca8210: Stop leaking skbs Date: Mon, 7 Feb 2022 12:06:35 +0100 Message-Id: <20220207103800.038514573@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220207103757.550973048@linuxfoundation.org> References: <20220207103757.550973048@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Miquel Raynal commit 621b24b09eb61c63f262da0c9c5f0e93348897e5 upstream. 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 Acked-by: Alexander Aring Link: https://lore.kernel.org/r/20220125121426.848337-5-miquel.raynal@bootlin.com Signed-off-by: Stefan Schmidt Signed-off-by: Greg Kroah-Hartman --- drivers/net/ieee802154/ca8210.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/net/ieee802154/ca8210.c +++ b/drivers/net/ieee802154/ca8210.c @@ -1769,6 +1769,7 @@ static int ca8210_async_xmit_complete( status ); if (status != MAC_TRANSACTION_OVERFLOW) { + dev_kfree_skb_any(priv->tx_skb); ieee802154_wake_queue(priv->hw); return 0; }