Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2750030pxj; Mon, 31 May 2021 09:47:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvo6Yl38ZA6sP+hU5SiNVq/LUojSNzHueFGGmJiw3Oc0wKfflLk+ftD+ycz2cSGxZqFC3E X-Received: by 2002:a05:6e02:218f:: with SMTP id j15mr17879189ila.249.1622479655593; Mon, 31 May 2021 09:47:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622479655; cv=none; d=google.com; s=arc-20160816; b=d6qOQ3p2rpRce8gkxqWQ1HlW2owZ1hJBXiWM75ByirgzTbDNrkn8yB9Fr9D7qSSn3R 7kxvKQkO/idyRLSWWAXMhuEcFD77cUG+5fEBTx6s7fcQnfaQ0tnDdDw/8J2ctZPm0t9j HBDLskWmSE4UYUBWwztJOI9s4FyZTxoTa6XUCBBORE3g6aqoGcpKJkqibTyEJlk9C1Fr 66IRqYCUoB46u99A6dIHOvSF5t+mctxEDAchdgr9ueJ8I8glO9tGQPimLn3GTRP49uqT L8EB3HhsjU10V4wkQ65msUf/RLi1ScVi2p6XLR+wTr+phasHpiXHziKlGsrP3MN6K2YK PlEA== 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=OkLQQxBXzKpoPvPzFQItc9DlZ4dWmFXgqS6pta1pUbo=; b=v9CVuuuvp6p6ayVAvbPcZGDn3HEo/FlRHHDGuHLdYYgiz7G7W25u00L9bY3NJ3qGNN GtfaunvUSW0YSOYL4QARy3hkFeD8xOwqR3mPZPR6JeKPf81E10HXr0WOfUHAVMddtufv 96nhI8go3M3wAe2UZdSgLKwFoC/yq64SgyckTiI9d2q9izI7Nl7QReTgO8ME9/1riZMW d3AoHXrFrzshxrJ+Xt0JlB+A6/R8ge4FoYH2M0JzQsFo6wcU3ZvEuv705syfkfsVRaay 1JU5BPKcRBN4WFP3pNoXTzEs2GXMIaSe6OmqdwPUa04t9D9wX2MN34pEHiU2Kwtn/Ek8 xPDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="pXEYY/of"; 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 k5si15229762ilv.81.2021.05.31.09.47.22; Mon, 31 May 2021 09:47:35 -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="pXEYY/of"; 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 S233263AbhEaQs1 (ORCPT + 99 others); Mon, 31 May 2021 12:48:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:45736 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234091AbhEaOxo (ORCPT ); Mon, 31 May 2021 10:53:44 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6EDE461CB2; Mon, 31 May 2021 13:59:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622469546; bh=pBUucN1CUmgv4k81TvkPDg3hIErTW1iRDuFbp3Yj5vw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pXEYY/ofeG7zzZ2f4qgsaSlT1oT7HdeMuGmbPJtMjvvg9T0n5cXoRQySm6CGE7zfI TalZR0UWAg5/6OToGiCF5Lm4QtD2eG8m9KRLspK9zUsngj00b5xUNv0kLR2Jg6AmZC Eq45jJocaHhglg4/aD1zcqSXWbz8P2QqFl5pMBqQ= 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 5.12 237/296] net: mdio: thunder: Fix a double free issue in the .remove function Date: Mon, 31 May 2021 15:14:52 +0200 Message-Id: <20210531130711.769463303@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130703.762129381@linuxfoundation.org> References: <20210531130703.762129381@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/mdio/mdio-thunder.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/mdio/mdio-thunder.c b/drivers/net/mdio/mdio-thunder.c index 3d7eda99d34e..dd7430c998a2 100644 --- a/drivers/net/mdio/mdio-thunder.c +++ b/drivers/net/mdio/mdio-thunder.c @@ -126,7 +126,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_release_regions(pdev); -- 2.30.2