Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2934235iog; Mon, 20 Jun 2022 07:47:53 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u35RupK7zxhjeJh39NLS0dECsfy4arYump3/Gpby2dbSKhksdwlDf3VhZRYG+BD9ziQz5v X-Received: by 2002:a05:6402:329a:b0:435:8935:e95d with SMTP id f26-20020a056402329a00b004358935e95dmr3939210eda.257.1655736473583; Mon, 20 Jun 2022 07:47:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655736473; cv=none; d=google.com; s=arc-20160816; b=GRpanCL+mp1rsxoOxjfix/Q9WZPTL186RjrWzGKr5cDbli0YWf8ShDqdqWhuAz5C0n VeevIRVFFhvyRE1rzWCbMukG6P1WcbgYQ4a1w6onyDqxxKmsKcuMX5E6LSTyjKhOyi+s duKG9AhI2Tu9fxYtX/5w8xZIAO56Son6Y7wyRJsvWTPAGNDpnpthuENO5sDWmXYvuk/N gPKr7NP8arKvvZ3NTkNn5PvZQNkcbSpQODATEgrfKmHqygIP9Kb/pr7tC5K1972lN3t6 Snopud4/mrFiI2iu6Vw17s4sLnPAcJd/KC/hcmnNC7h3WuE5O9m5qlwkgM3Jj6XeFfmb g4DQ== 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=qpMiQ/tyh6xPdB9SJFLmmbCPgxoXvG/Os/3K1lwXai8=; b=N14o9MM0Ej5mc4PLx6WCBM/lnBRpBE1JBv+azfVcqZKin+x5fweosoLDsR6Vtf0p8p I7PMRuB2kDllUwEu8q8HLJXCjQqLsKlIux5q82+XfRgnVw3hLEGR4UzYdzpKhWCon5DT 5fUcHIhdroOzO/xabeN1nuwnYftkRtgjOnVhlj1zTnm24E4yyqvvurvppj6/DaNYGwi/ PLEbu4w4+Wb9BBj8LDNT8vdGmk0akGDaeNy6gyguq2VOAIHgilt83zrJ5v5b13SvNWdD SrcG4/nDqfSDBUqPXVNs8hklZeMTBiKt55cEYdips8Bxu4SuhbbTvJ+KV2XFnVIeneIw Gc3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zQc9ONZP; 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 g33-20020a056402322100b004357fb2422dsi4064840eda.456.2022.06.20.07.47.27; Mon, 20 Jun 2022 07:47:53 -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=zQc9ONZP; 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 S1351176AbiFTOJG (ORCPT + 99 others); Mon, 20 Jun 2022 10:09:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351697AbiFTNzL (ORCPT ); Mon, 20 Jun 2022 09:55:11 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F64A33E29; Mon, 20 Jun 2022 06:21:27 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 32D2D60FF1; Mon, 20 Jun 2022 13:21:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 267AEC3411B; Mon, 20 Jun 2022 13:21:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655731286; bh=AlClyu+GjL/SoVXz6DUGT+j8OYRuamyCPoBUwuhZJGw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zQc9ONZP0eWUH/f6QS2yL9ibOEcnEhtajqeUWwC5edRS1i/2iuaxXVul8Dygjs+e7 oOdi7ibegqTMFLY2tVm8HNGicqEMc/7ZLP/cWxavuW/d+yjNKFzxiSo13R2Shyr0po 5U9wfMIWzJ3FV5ZfXT0W+a538aD71toFzU96dTMU= 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 5.4 213/240] net: bgmac: Fix an erroneous kfree() in bgmac_remove() Date: Mon, 20 Jun 2022 14:51:54 +0200 Message-Id: <20220620124745.147018699@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220620124737.799371052@linuxfoundation.org> References: <20220620124737.799371052@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 34d18302b1a3..2d52754afc33 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