From patchwork Fri Jul 22 04:33:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuanjun Gong X-Patchwork-Id: 12925961 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 05685C43334 for ; Fri, 22 Jul 2022 04:34:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230318AbiGVEeT (ORCPT ); Fri, 22 Jul 2022 00:34:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233628AbiGVEeS (ORCPT ); Fri, 22 Jul 2022 00:34:18 -0400 Received: from m12-11.163.com (m12-11.163.com [220.181.12.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3935287F5A for ; Thu, 21 Jul 2022 21:34:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=L5FMe4DiXQZDPvzG9V liD9vfeB80xyvqaoeLxnLvibw=; b=IYsDpQsATvyWsIaJ3cweu298EE7dtaoVnp HEIeWL+4mNiolNFGxDrSr8KShITYfe5OzsqYt8uHit9TY+C8/dACdz1b0Ni/vCK/ VIoID/VhwhXt3b5d/re2w5c8uZVeuWvcVXFxBmyqKQ6VB371y9CepPJSxkddMjfO rai3rqeyo= Received: from localhost.localdomain (unknown [202.112.113.212]) by smtp7 (Coremail) with SMTP id C8CowABXu5CZKNpiKw5PPA--.51114S4; Fri, 22 Jul 2022 12:33:53 +0800 (CST) From: Yuanjun Gong To: Yuanjun Gong , Kunihiko Hayashi , netdev@vger.kernel.org Subject: [PATCH 1/1] drivers/net/ethernet: fix a memory leak Date: Fri, 22 Jul 2022 12:33:27 +0800 Message-Id: <20220722043327.2259-1-ruc_gongyuanjun@163.com> X-Mailer: git-send-email 2.17.1 X-CM-TRANSID: C8CowABXu5CZKNpiKw5PPA--.51114S4 X-Coremail-Antispam: 1Uf129KBjvdXoWrZF1ktrWUAryrKr18uw4Uurg_yoWxtFXE9w 17Zrs7Xa1DCryYv3y3CrW5AryFkF1Duw10g3Z8K3yrZFW7Jr15Xr1kur17Ja9rWw4xGF9x Cr9rXFWSy343tjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7VUU8wI3UUUUU== X-Originating-IP: [202.112.113.212] X-CM-SenderInfo: 5uxfsw5rqj53pdqm30i6rwjhhfrp/xtbB0BFG5WEsrazCPQAAsR Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org In ave_remove, ndev should be freed with free_netdev before return. Signed-off-by: Yuanjun Gong --- drivers/net/ethernet/socionext/sni_ave.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/socionext/sni_ave.c b/drivers/net/ethernet/socionext/sni_ave.c index f0c8de2c6075..9d1c1cdd04af 100644 --- a/drivers/net/ethernet/socionext/sni_ave.c +++ b/drivers/net/ethernet/socionext/sni_ave.c @@ -1725,6 +1725,7 @@ static int ave_remove(struct platform_device *pdev) unregister_netdev(ndev); netif_napi_del(&priv->napi_rx); netif_napi_del(&priv->napi_tx); + free_netdev(ndev); return 0; }