Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2708633pxj; Mon, 31 May 2021 08:46:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTN1SzGxYaaRqcy/3HFiNM6TEXc9EbQdxDbYhFgAzZDaGN8e1scNykTIXuoUeYDEZUaqHl X-Received: by 2002:a5e:9e4a:: with SMTP id j10mr17871940ioq.52.1622475978041; Mon, 31 May 2021 08:46:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622475978; cv=none; d=google.com; s=arc-20160816; b=jVkaOLMNEh1XIyfMZarf0G2ExTcfMGNyfoHjw7+WaLhfza+nYhCVkwkbpmxQeYVJua JDiaFJ18Gxc2NIeyJaIN5OW36D3f3QlNgKml9mxNNk15R5E0NNdoxqJ13+elefAET3rm EsoOA1caxWziYy2T4GXijy86yG3Hz3ggutLhUipafgmJoMhjjZHIfZAHLA5guCbBXoGQ C18WlyvZvmz2MZAm9SZmeMh7LUzgZpzkI9K797HikfQWHMZNzH2dRBsY67Q6JY+XjAlT 9L1Se1rj40NZV3eGEdVslkXUWHZ4BwOwfHYjShqh2ldnaohKLhktUanJZoA3WQTbC8hF ZVVA== 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=vDXe15YvRysfNhMrAkEeso6D8DaDEKf6vscLjTT0pP0=; b=Rgkzsa7f8UXKEeDUa2WryT19hLTxer2ItRbvriRHq4TFq8u/hIg+kuP01yajzBBp/Z MqKlptvQAJxoxyYc/zdPlPB7YVGXEc42SVutnSZkwujF7nKOLUZKOaI5uc+0iHnrRS22 1tiW5NZ657c+Mt3z5mF2E/yX8acvTs252FdQprGqkSO4ixoTebOtquo/hrVa8YM4wxCh qHId5GLdvcITTfAKQksGbTuL00MqX44dnLgvkumcTJe03q+Ts1cqpIRQm6FoxSqMwYKX q9T1VFeXe+hv9DmvXQcqWZgVUx3735PWzk/TNUuptPGzz+mMqqAt21oifrGqQdxIfCfl 4kZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MWGO5GdL; 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 t19si13005340iog.66.2021.05.31.08.46.05; Mon, 31 May 2021 08:46:18 -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=MWGO5GdL; 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 S233645AbhEaPrP (ORCPT + 99 others); Mon, 31 May 2021 11:47:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:55142 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232226AbhEaO0F (ORCPT ); Mon, 31 May 2021 10:26:05 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D72E26162B; Mon, 31 May 2021 13:46:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622468818; bh=/KPhMXtE6Gel3LC66DtyO7p+G798alWq8oCpoGdXxYA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MWGO5GdLnbhfFus1U7J6Q7SbSCN687C2Agnzqz1jPJms+bUDV8Pr3i6MpRz8c3+1a HNjPPX6MqcY2VLzuGX3S5hfAdSHUsS0BqQ+ynFzUhfzBSLYSWKzWldaJFUGIxV4Uxo +SRVPiOf93bNgWcuZCwYoLGkJ2VMokqgKMVBEJLw= 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.4 141/177] net: mdio: thunder: Fix a double free issue in the .remove function Date: Mon, 31 May 2021 15:14:58 +0200 Message-Id: <20210531130652.815942801@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130647.887605866@linuxfoundation.org> References: <20210531130647.887605866@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 b6128ae7f14f..1e2f57ed1ef7 100644 --- a/drivers/net/phy/mdio-thunder.c +++ b/drivers/net/phy/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_set_drvdata(pdev, NULL); -- 2.30.2