Message ID | 1668657419-29240-1-git-send-email-zhangchangzhong@huawei.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp196256wrr; Wed, 16 Nov 2022 19:44:34 -0800 (PST) X-Google-Smtp-Source: AA0mqf66ZWZW5g9CW4YwI1ZOTjh0fVLNnc3s+zpdsq8zhgrHqv/NN+LhI3wHhaN8wDJaZXPGwruw X-Received: by 2002:a05:6402:1f03:b0:468:7be6:55e7 with SMTP id b3-20020a0564021f0300b004687be655e7mr554481edb.345.1668656674293; Wed, 16 Nov 2022 19:44:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668656674; cv=none; d=google.com; s=arc-20160816; b=0L830SoYtRSo2JCs2Lx1St/hckSJMqKuG1I+SzO4aWwqvsW7o1xAeoWAYsQ4At453g iLGF669vX47qL9OPSamLH5ZCe2FbW6lIxccJ63a7KmRhtKWFrY1jZ+37Z5ggvNDqxi5R jRHCwfHYDbEZVjegYF0Wblzt4OKIvFEa3PRP5RP9/dg/yYX7xCN1sdLy6dfwED9NKwb8 8gBgS4NA1ZPX3ccO3Y7pgt0+3Lg7jCmaU3GToganO0Zv57K/RD3nNAyR2m0UzeLE3H/x 3e4igAkXKNQSwSgSg6pKIgz4ORuqxJ8dd748317Z7zFZiSlZMSIk88BoOTKZy/7sP9z7 YVww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=HBQgNG/RnWj7nDhqeJUtJwfj1rh90sPHE2xonssdOOE=; b=q6Glbkjr7icg3yqVqX6rEKZaU/SwzjKO6ZmdS5+4Ik1/edBYI1bvjiWhqd1R/lqjCS GVF61cQqSegir1tV2Fpdh2jtSe8YPo/PkqDfYa57rFYmWZrK7gruGJJg8zGEWKM+0B1y ckcfOCSWgC13L03Q/Oz/5feBoxE9pC53J017P2lhGUDyG4sYd6MF6uq/SUyzY97WGRWZ gvVlcUS9YpNtD9vp8CQsd1dJL+X+k1MOdR+/5EKJo2O3CPnl0ntwdzC1NaKAkTsaUor0 yEopeqDtf5ITOOwTx2pX67pRbVaGNNYdl8fWAg0ED1hDTHURjd4LJWE+lzX2UT6O0boO 75UQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sc16-20020a1709078a1000b007316ac034acsi16830071ejc.834.2022.11.16.19.44.11; Wed, 16 Nov 2022 19:44:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234444AbiKQDhX (ORCPT <rfc822;just.gull.subs@gmail.com> + 99 others); Wed, 16 Nov 2022 22:37:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232905AbiKQDhV (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 16 Nov 2022 22:37:21 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E1F0E1D; Wed, 16 Nov 2022 19:37:20 -0800 (PST) Received: from dggpeml500026.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4NCQZd5xY3zRpGD; Thu, 17 Nov 2022 11:36:57 +0800 (CST) Received: from dggpeml500006.china.huawei.com (7.185.36.76) by dggpeml500026.china.huawei.com (7.185.36.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 17 Nov 2022 11:37:18 +0800 Received: from localhost.localdomain (10.175.112.70) by dggpeml500006.china.huawei.com (7.185.36.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 17 Nov 2022 11:37:17 +0800 From: Zhang Changzhong <zhangchangzhong@huawei.com> To: Ajay Singh <ajay.kathat@microchip.com>, Claudiu Beznea <claudiu.beznea@microchip.com>, Kalle Valo <kvalo@kernel.org>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, "Jakub Kicinski" <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Johnny Kim <johnny.kim@atmel.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Chris Park <chris.park@atmel.com>, Rachel Kim <rachel.kim@atmel.com>, "Nicolas Ferre" <nicolas.ferre@microchip.com> CC: Zhang Changzhong <zhangchangzhong@huawei.com>, <linux-wireless@vger.kernel.org>, <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org> Subject: [PATCH wireless] wilc1000: fix potential memory leak in wilc_mac_xmit() Date: Thu, 17 Nov 2022 11:56:58 +0800 Message-ID: <1668657419-29240-1-git-send-email-zhangchangzhong@huawei.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.112.70] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpeml500006.china.huawei.com (7.185.36.76) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749713340629851603?= X-GMAIL-MSGID: =?utf-8?q?1749713340629851603?= |
Series |
[wireless] wilc1000: fix potential memory leak in wilc_mac_xmit()
|
|
Commit Message
Zhang Changzhong
Nov. 17, 2022, 3:56 a.m. UTC
The wilc_mac_xmit() returns NETDEV_TX_OK without freeing skb, add
dev_kfree_skb() to fix it.
Fixes: c5c77ba18ea6 ("staging: wilc1000: Add SDIO/SPI 802.11 driver")
Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
---
drivers/net/wireless/microchip/wilc1000/netdev.c | 1 +
1 file changed, 1 insertion(+)
Comments
Zhang Changzhong <zhangchangzhong@huawei.com> writes: > The wilc_mac_xmit() returns NETDEV_TX_OK without freeing skb, add > dev_kfree_skb() to fix it. > > Fixes: c5c77ba18ea6 ("staging: wilc1000: Add SDIO/SPI 802.11 driver") > Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com> Same as in your other patch, have you tested this is on a real device?
diff --git a/drivers/net/wireless/microchip/wilc1000/netdev.c b/drivers/net/wireless/microchip/wilc1000/netdev.c index 9b319a4..6f3ae0d 100644 --- a/drivers/net/wireless/microchip/wilc1000/netdev.c +++ b/drivers/net/wireless/microchip/wilc1000/netdev.c @@ -730,6 +730,7 @@ netdev_tx_t wilc_mac_xmit(struct sk_buff *skb, struct net_device *ndev) if (skb->dev != ndev) { netdev_err(ndev, "Packet not destined to this device\n"); + dev_kfree_skb(skb); return NETDEV_TX_OK; }