Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3577054pxb; Mon, 24 Jan 2022 12:38:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJwz7UQM2Oe/LZwqYeN72vF+6c7/vrXHcyhEPAd7iMNVu+8wA5OqKK8/EmSfBPZoy9zoGaR3 X-Received: by 2002:a17:90a:5d07:: with SMTP id s7mr91273pji.226.1643056709855; Mon, 24 Jan 2022 12:38:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643056709; cv=none; d=google.com; s=arc-20160816; b=cUBaiYiET5uBkb+NVRGArE6nMSh4aZ0Eo2qOz/+eFIDtbAgfOMNNjpyCltT44QO7lX wbhx4JvCgY3WX5nZPYPS9AUqRZKyYm0oYYQUhsc6ZN4hNXCnuHypHlVcVKJm6871O6Kr KqxD5CluWj3VnDOx8FI6s0F+Yx/pcjkpzbrpZczfEiS3DeHkZjzc3FR/HTeCLG/EGeSc zZMHGEkTJlQThnyrvrb3qNd/W4KUUSBB96uzFqoWARk3mwY6e4ISho7YRTwru1UVsiVz rlMLsULWfhmI9MGMaqKa5BICMgYvVqykxTYeNUKMM7ra9e8htXl2XeiQISVxk4Dps79o IYPg== 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=Np1Z9SJeUIGq3xTJ2TZUk5O4Z7UB/QgZp/0FCEJprIT2J9XNuU/q/9bG/63f3dVEL6 QhWV5hN4WPwMyZqq9XxxpeWEGl92vabBnXCx683ZjvNOa+Y4bmXBL0XVRqwRfogxfQPw E2QSGUPdKF9ZEmNVUzdWN0TNYPrzPO12uW0SRxKpgsEN0qcqgRH7+c1IbZvWjPDVv9yU MvwJUm1qkjMS7Gb+p1e0N0d7hVIrzX6oIM1Dm9LqeCdhp9fBIUUiZJffu24Ux9MMIJnD KAJveHHRXwWn/YQg8TqtZ4ozGMdoFwBKZhLtB+S0MnbGIZxUtf5rGeY+AsKeAA1wlnss 8FRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xU+gvj78; 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 z1si480564plk.513.2022.01.24.12.38.10; Mon, 24 Jan 2022 12:38:29 -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=xU+gvj78; 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 S1357181AbiAXTt3 (ORCPT + 99 others); Mon, 24 Jan 2022 14:49:29 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:36706 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353484AbiAXTjC (ORCPT ); Mon, 24 Jan 2022 14:39:02 -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 dfw.source.kernel.org (Postfix) with ESMTPS id E72D861488; Mon, 24 Jan 2022 19:39:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C5273C340E8; Mon, 24 Jan 2022 19:38:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643053140; bh=SkxgkeQKtRzsXP4qhrbvLWmh+8iL7PKLaOqj4Z1DGOc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xU+gvj78NmToGMFgaMO3Zbs1kq1CykbkBIXxJydaHLaWFvUgFQ58p4aAQzzIwGeav /GaApy7Bse7lrshFkzjV/8sJ5vPMcx2td9khEORSdtsiFP6cwY7eM0OTFWGJctHQfW zxrI+dGgUvpf4YO6yRs8AwQtXp5PoN6XYayA6n9Y= 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 5.4 290/320] net/fsl: xgmac_mdio: Fix incorrect iounmap when removing module Date: Mon, 24 Jan 2022 19:44:34 +0100 Message-Id: <20220124184003.818013973@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183953.750177707@linuxfoundation.org> References: <20220124183953.750177707@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;