Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2638769pxj; Mon, 31 May 2021 07:08:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyhvqg4OFraQ89ErSzIhhACIjZAQ77XhfaraJp/CJ/PPqwp00O2A5uMpqS99qVBKQ07PZuu X-Received: by 2002:a92:cc51:: with SMTP id t17mr3784842ilq.113.1622470130274; Mon, 31 May 2021 07:08:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622470130; cv=none; d=google.com; s=arc-20160816; b=T2B5K68C1lF2ktBcHB7O1zE/GLV+E6nGVuP2NVe1fcLmPK+kRj+RxrL4lfP7/LiGLl RJ5YmaPKUdawKrM5Zsz9k76yutqqS2yHKoBYyBWmdzQ8Qf5+JMNJyL5UzNugIrCT8L2n /XGsCeNSRqyIeKhcTUSdrd7vTqRfEbhFNgLHg/ikvE+Ug4xRgySunBaU4U7ggIlOgJ4T jbwwwB/XOcfRv2wx7WqxUvPDa0/UA6qO43t14e24PiNVeijA+K3aUgjg9kYLidztlTmg pCTErnuFJHoVWLdq7A/vsD5DyMS1pVmaXkzoNUyVx3XtUVqonGHWjBJYUrTyJSf3nw89 HI8Q== 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=xA41mU8+Ar0+dzZxUWsE3fKmZIBtz5FGBBaZFpMOdvg=; b=Qg+acvm+UpsReF/rAZkoR0h4B1vUOd8AMcnhRi0Vcj64KUzK4iSD8tGlqLLBEUG1f7 STpXajz84KM35GqnqYLOxlDLTE5+/0gjKTz3kC1UgJHgHSqoGKSsNvjcR7fonLvf2QYg I1Z/WZYUgSuSNbBs8tqxAixA+CxGZoh8Z3K4SaOxqGNJeOTdKanwORGzYPyC3R8D76sg FC6uozB18iLzrbnHigNo3kIJCek7hAa2lnoI11BDhnI8hI564g1ESWB5Gm1xCvC2hA9J PcsosVcYNVfMLOMHy2Zk3kstMa6v1ZmZo11aOqRDu7PwZWk1TJFuCx4PavofDcibrcl1 bQ1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kYn7iJyA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x99si13489670jah.122.2021.05.31.07.08.36; Mon, 31 May 2021 07:08:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kYn7iJyA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S233542AbhEaOJi (ORCPT + 99 others); Mon, 31 May 2021 10:09:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:50196 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232488AbhEaNnl (ORCPT ); Mon, 31 May 2021 09:43:41 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 82420614A7; Mon, 31 May 2021 13:29:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622467745; bh=DbpjfWwOX5w4DXwVz2QROu43Vb5DxDjYUSn+itNusMo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kYn7iJyAt/MpCKtsLarLZfkJV4j3sGmPunyhdqeK0kHQ0NVdiS1utYZylWbHTKqyr vXO8rcd1m1OUuv5zu49EnspY1fSxNb8d4n/Ib5zVZPiHTPXBPOT27FV8d0nfVWOJpZ RHiaukif06LOl6euEDPGNvzX/Z5bWHSeYnsgBl0A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe JAILLET , Russell King , Andrew Lunn , "David S. Miller" , Sasha Levin Subject: [PATCH 4.14 64/79] net: mdio: thunder: Fix a double free issue in the .remove function Date: Mon, 31 May 2021 15:14:49 +0200 Message-Id: <20210531130638.043504743@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130636.002722319@linuxfoundation.org> References: <20210531130636.002722319@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christophe JAILLET [ Upstream commit a93a0a15876d2a077a3bc260b387d2457a051f24 ] 'bus->mii_bus' have been allocated with 'devm_mdiobus_alloc_size()' in the probe function. So it must not be freed explicitly or there will be a double free. Remove the incorrect 'mdiobus_free' in the remove function. Fixes: 379d7ac7ca31 ("phy: mdio-thunder: Add driver for Cavium Thunder SoC MDIO buses.") Signed-off-by: Christophe JAILLET Reviewed-by: Russell King Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/phy/mdio-thunder.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/phy/mdio-thunder.c b/drivers/net/phy/mdio-thunder.c index 564616968cad..c0c922eff760 100644 --- a/drivers/net/phy/mdio-thunder.c +++ b/drivers/net/phy/mdio-thunder.c @@ -129,7 +129,6 @@ static void thunder_mdiobus_pci_remove(struct pci_dev *pdev) continue; mdiobus_unregister(bus->mii_bus); - mdiobus_free(bus->mii_bus); oct_mdio_writeq(0, bus->register_base + SMI_EN); } pci_set_drvdata(pdev, NULL); -- 2.30.2