Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp6101630iog; Thu, 23 Jun 2022 11:20:51 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vXKEWXmP3C3eMOV0nSFja0fAU/pL2hdKiiCPpobiaVvz117IcXGWC/PERcKMBjiL3TMaKK X-Received: by 2002:a17:907:a420:b0:6ff:1541:8d34 with SMTP id sg32-20020a170907a42000b006ff15418d34mr9199399ejc.447.1656008451445; Thu, 23 Jun 2022 11:20:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656008451; cv=none; d=google.com; s=arc-20160816; b=t0IcoVBFDSInkfY8e9UaavkGJ1boFHo/1M2GK05AHjzWGCDRbpiuRgizmuQP5DC6Sy W26ZyPXs1ZxfWl5JdTPVwsvh0/Z6/PD7AsIFaMRZHFifS6IFvEyPEQNRojyeUxRoMch7 faG+8e+kLc8kle6lI5DobQAcobTGAHi7oLoiIOc/3WPGlc94xJrYw9nJU1SgYfI+rrVX QCO2arK2pIJU1/wQJz7nJsmArBB9K6VliY4NKwvUjmdKgxy4hlTi59BjK00//qxtc0pc lV+WxbxqtVTKiMLfRV39vd/M5OSiVldVlLDaTfVGaVTTbvTef5eiVHq7n/fVtIh0kdei FFsQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=VaDe2sjvzQS+Q6Uiufv5f4d1jl10hCZAPO1zWUZB9Lw=; b=Xg4Yp1xiIX9zUQ6B/0np4wa0mGxHVQG771Nt0OGvIchPxe6+kYuN+7zTN2Kj8+FHJm lF1ltueM1qtXKsXj0ahw2LynhlOvTMCZBHKso2x660cH9BoVhJoVS7DkzUfZluQGlvkR Y+oJpWxPqbIpeM0VuiYEGGvoIniYFzZAovi1p9yVWwPv7L2x7q2E05vP0Ky9V5yEuf4Z cZ0FtMBsYysYx9yPLZHGoFoKPxFG6S9+XUg3NyzO/q1O+C/ZjBkc5MxOO31L7MSF8viq AvXDbd6ZtnupX7/Y8N7CSzNcilbHxo4ZYRb3uXtHa2kllmcqbt9c7FBLY/wMfhtiHYJT p8sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oHw1EB8B; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h8-20020a056402280800b0042fafec8901si447539ede.130.2022.06.23.11.20.19; Thu, 23 Jun 2022 11:20:51 -0700 (PDT) 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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oHw1EB8B; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236752AbiFWSSm (ORCPT + 99 others); Thu, 23 Jun 2022 14:18:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236649AbiFWSQj (ORCPT ); Thu, 23 Jun 2022 14:16:39 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DC6C5DF3C; Thu, 23 Jun 2022 10:22:47 -0700 (PDT) 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 ams.source.kernel.org (Postfix) with ESMTPS id E606EB82497; Thu, 23 Jun 2022 17:22:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 34B05C3411B; Thu, 23 Jun 2022 17:22:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656004964; bh=doF68dwNo/0j2Ifv89fr9IA4rOEUOkkjPSz9Y/k4/pM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oHw1EB8BOxPeJPt3ztA/6G1ATx8oE5kY2BxpuKBUT5uG51zo7FPQ7jGSG+URsyf7j gAtVr/JAG7odYeNFwUQ/eWA5SETGxGZVjGtZyF1x/62n37KTr0v4mGubVqfyh6I7MS qXWIWXqmaZHCWzZY4rMvNHXE1VxCJ1TowdhyUQeo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe JAILLET , Florian Fainelli , Jakub Kicinski , Sasha Levin Subject: [PATCH 4.19 205/234] net: bgmac: Fix an erroneous kfree() in bgmac_remove() Date: Thu, 23 Jun 2022 18:44:32 +0200 Message-Id: <20220623164348.852662943@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220623164343.042598055@linuxfoundation.org> References: <20220623164343.042598055@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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-kernel@vger.kernel.org From: Christophe JAILLET [ Upstream commit d7dd6eccfbc95ac47a12396f84e7e1b361db654b ] 'bgmac' is part of a managed resource allocated with bgmac_alloc(). It should not be freed explicitly. Remove the erroneous kfree() from the .remove() function. Fixes: 34a5102c3235 ("net: bgmac: allocate struct bgmac just once & don't copy it") Signed-off-by: Christophe JAILLET Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/a026153108dd21239036a032b95c25b5cece253b.1655153616.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/broadcom/bgmac-bcma.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/bgmac-bcma.c b/drivers/net/ethernet/broadcom/bgmac-bcma.c index 6fe074c1588b..77de92eb08b2 100644 --- a/drivers/net/ethernet/broadcom/bgmac-bcma.c +++ b/drivers/net/ethernet/broadcom/bgmac-bcma.c @@ -323,7 +323,6 @@ static void bgmac_remove(struct bcma_device *core) bcma_mdio_mii_unregister(bgmac->mii_bus); bgmac_enet_remove(bgmac); bcma_set_drvdata(core, NULL); - kfree(bgmac); } static struct bcma_driver bgmac_bcma_driver = { -- 2.35.1