Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3555997pxb; Mon, 24 Jan 2022 12:08:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJz3aGUZpeprfrIR9kWN9M4A8Hj1XdktSAsO6oUW9CLyZSuv+Y+m/Eyzsi/w6YTSbeoqnlj2 X-Received: by 2002:a17:90b:1bc7:: with SMTP id oa7mr3518308pjb.131.1643054889918; Mon, 24 Jan 2022 12:08:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643054889; cv=none; d=google.com; s=arc-20160816; b=h+4V3fGRy1q+svuAq+NVL8f0iBw2q7A7hwbejY7saqePxeajUQUGdn8XYFLyLWXNe8 Q4fRmdLtf9f8cAEkEZxrSPx/yiLMCpMs7bhtTOn6ZQTPNX47C7HASah96qORj92dECRL WgTWOaSqkZ1Sp7nS+J5Ei/3+81PuRCgPYY3S/ep0KK7TLAtF2tp8hDPcv0N8WtYwN9qJ TG3j6NtEeA5QYTP0gMYrHAURqkHhQGPnumzaT60bF31fv60P5+rZvxlLF14ejvmdWTfj wUZ1hy+nO9HyqWC9HH8zVfzW53ci/aVQBz33g+PCuljr+vyKrweidLxmXmcZfaxymLKr a32A== 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=TjkzGQ3tdh7wZU7q/SkSn8rpRJMtcqCyMCINSNhvzkw=; b=HkWibk3gdJ3fbI2FfhzPE7Y28MOg6l2wVegef/EwZRafZkRBqFPHZht1Sd+Iel18GA qeDMDn9AeLTvHZjbL4WJe3/S4i4HRQKJHRiKCHZCkrezn+9mvgvoxQuQ1n/vP210Nzwg 5Bgaoybqqn95q7WYMR3n9AJpskcMuGiexu25iaot4ME8VJGT+VFTrSNosL8zQUA5lAj8 ezDs/TM8fZi0YAQtxaNyRqEpn9akuW8DedPahq4zx2OnOftFD0KO2w9ag/3ziV7ZYmQy pQRZwvC9QKYs2jsfuFSxBvIFDqRiUBZtfUNSFCWAxPWdUPMCI5+4hsVmwEuVCnAuWJEC HTcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="ZpMdSy/S"; 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 gn19si264182pjb.114.2022.01.24.12.07.56; Mon, 24 Jan 2022 12:08:09 -0800 (PST) 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="ZpMdSy/S"; 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 S1345880AbiAXTGd (ORCPT + 99 others); Mon, 24 Jan 2022 14:06:33 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:57212 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345644AbiAXTAr (ORCPT ); Mon, 24 Jan 2022 14:00:47 -0500 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 6269BB81229; Mon, 24 Jan 2022 19:00:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 907AAC340E5; Mon, 24 Jan 2022 19:00:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643050845; bh=SkxgkeQKtRzsXP4qhrbvLWmh+8iL7PKLaOqj4Z1DGOc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZpMdSy/SpIjTtP0dOW81bGT65ATdcNLUyrqq7CuFS5nAYIxB2f2LVIW52ZKDRrbg8 hOfZt2UZD3XHxmJW5DnlZytwEKVR7tNIV72l6bG8QJRWxiagrO+uDBAp6UABJjOs9o kLhqpd105EKImXUH7nzIjyHrsOfuEzPDnKZ3X0hI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tobias Waldekranz , Andrew Lunn , Jakub Kicinski Subject: [PATCH 4.9 131/157] net/fsl: xgmac_mdio: Fix incorrect iounmap when removing module Date: Mon, 24 Jan 2022 19:43:41 +0100 Message-Id: <20220124183936.938138098@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183932.787526760@linuxfoundation.org> References: <20220124183932.787526760@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: Tobias Waldekranz commit 3f7c239c7844d2044ed399399d97a5f1c6008e1b upstream. As reported by sparse: In the remove path, the driver would attempt to unmap its own priv pointer - instead of the io memory that it mapped in probe. Fixes: 9f35a7342cff ("net/fsl: introduce Freescale 10G MDIO driver") Signed-off-by: Tobias Waldekranz Reviewed-by: Andrew Lunn Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/freescale/xgmac_mdio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/net/ethernet/freescale/xgmac_mdio.c +++ b/drivers/net/ethernet/freescale/xgmac_mdio.c @@ -301,9 +301,10 @@ err_ioremap: static int xgmac_mdio_remove(struct platform_device *pdev) { struct mii_bus *bus = platform_get_drvdata(pdev); + struct mdio_fsl_priv *priv = bus->priv; mdiobus_unregister(bus); - iounmap(bus->priv); + iounmap(priv->mdio_base); mdiobus_free(bus); return 0;