Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1507222rwb; Wed, 16 Nov 2022 19:44:23 -0800 (PST) X-Google-Smtp-Source: AA0mqf4l3HkNzbrncq9pJtHfSwOIViHUa4Lw2e9HUKTzAOs7lLaSsRMej56rxnMwqSJk5AOqOi32 X-Received: by 2002:a17:906:1dc3:b0:7ad:bbcc:814 with SMTP id v3-20020a1709061dc300b007adbbcc0814mr622545ejh.425.1668656663185; Wed, 16 Nov 2022 19:44:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668656663; cv=none; d=google.com; s=arc-20160816; b=EG6MguZ021j+JTZD/a8u8KuF6eF7xNJeZmkxH0rUmI/XosaWiRoz1RA+xXWb0q5I2i gFjrcWZVCSE2ezKtYQdby+mz95DfWKHyM19Pet/mhmWs6+PpUatqJQcJymliHVQggN1z KnfZ7Kj5syWCfnFCJAstDwLv7Av1fKLa8X+xSs4CnTVSSFdct1gbgbaBAkLNoMhuP1PH h6UjqJPcGj7qsS2wg3XfJ0oPodSyuKar1jas1nSuvAqbDxXf05bvQQxqVrI/lP/kSecF eE85iIG+E10HeYf25xBx5NyuWuvRa0gy9IEX/KEWacWAdhmhAGMZUPjppwINs4omMe8Y c2lA== 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=WilNO44aVsl8xLLO3a+BDcO42Cw4ra5mtwS/PL93JmTp4+wW93IzutPqSjcNx4W+2c NQFiNgZNyondLOk5QfEL5VS+T/gP0Pu+EvXxW+OXG6G77v7FwdbEqF0cPYrothHtPXRh vU15EutAh0voz0zuf1U6nt3koLug0q4QvcICkDfE8sWbQINS0/ZN1UXxY9Kb2NcnC/Np 1lM+9jV+AaLtbcVsjmaL8RHVLikEdGAokZyJfxphVqX8tObSshRKYTw7v7ttvPHs3YQk p9Jkis7AdTANeq0jPNV/A0zFrt3miXJxo2jt3Kv7zZYWSwXeQ5ydOnehHRg8SDKAqye7 EDmQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f2-20020a17090624c200b007adf6f0f962si14342185ejb.291.2022.11.16.19.44.07; Wed, 16 Nov 2022 19:44:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-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-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-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 S233980AbiKQDhW (ORCPT + 67 others); Wed, 16 Nov 2022 22:37:22 -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 ); 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 To: Ajay Singh , Claudiu Beznea , Kalle Valo , "David S. Miller" , Eric Dumazet , "Jakub Kicinski" , Paolo Abeni , Johnny Kim , Greg Kroah-Hartman , Chris Park , Rachel Kim , "Nicolas Ferre" CC: Zhang Changzhong , , , 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: X-Mailing-List: linux-wireless@vger.kernel.org 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 --- drivers/net/wireless/microchip/wilc1000/netdev.c | 1 + 1 file changed, 1 insertion(+) 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; } -- 2.9.5