Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3593199pxb; Mon, 24 Jan 2022 13:03:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJxbTwwYQVGyToRJBqIUPbegf8zJqYRboVNd6NO/fd60Ty/7t/T1D1d9x21ZW+vb12S3Psgu X-Received: by 2002:a17:90b:4b83:: with SMTP id lr3mr194996pjb.42.1643058227676; Mon, 24 Jan 2022 13:03:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643058227; cv=none; d=google.com; s=arc-20160816; b=xYomAzZCDL2Z93SGr7XE5TP+BcHhDonVizAiVRfBYJyk3b8XrdRM9Nc/scKuQkiiW7 4Uzx14oQJn8p4VpsjEzsgwRe5QBFWfhwBW5427LByvJ9riWaA/GLVeKScZFav2uovphB 5QSUgBG+AMbeSXnJSkcGjhfObKMYldaEVkD6oGBI2Or0W4Evg09wlgQKCHIOhjJxqDGS DolUPlkePZjqsdZDEqPoIuEPuqLfMHbcLpxx0zOtMafQigB98HH/osTka5/DWIAYgmaz PBPY/OaciijV3gIEN2FBvIeogky0/RuFQl/BgmBAzvTLW3dG7C4AkKiRZOMfY7XklY/K CI5w== 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=r7VdkHNSzcgRhNs4lYIz9BP7dGzTbbzcCOYPbvbHYoV1/mjqGkuTBxPAiVYoL7Ly13 R/bho2fEdsu6EAzFD4O4W45Mt8mYBbBbjfFQLJ92ulnaBz1ttFohzoSAwZqVxJtkBOFT gF2OZltw7v33QC1Lka1QJfp55BxzL5RIB/7XRAi7oKXR7dBQye+Iyeqp6x9l2F7RMaqb CeERr5qi5hlAZ1vwj8a+n54CIheSx/5gz/rOK2M5Xn+zuHJUo13PHbO3cCbM9yKXzD+t 6ZZrUpD9ShVi7kgSr9B6WHhydV8873gREAyK2U2X5TXe4c6FojFRFl5PAfdBExcg+PBi LMZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0EP+NX0B; 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 f2si14458002pgr.847.2022.01.24.13.03.24; Mon, 24 Jan 2022 13:03:47 -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=0EP+NX0B; 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 S1383513AbiAXU1S (ORCPT + 99 others); Mon, 24 Jan 2022 15:27:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346363AbiAXTvz (ORCPT ); Mon, 24 Jan 2022 14:51:55 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 788B9C04188F; Mon, 24 Jan 2022 11:24:36 -0800 (PST) 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 155E5612FA; Mon, 24 Jan 2022 19:24:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C9A21C340E5; Mon, 24 Jan 2022 19:24:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643052275; bh=SkxgkeQKtRzsXP4qhrbvLWmh+8iL7PKLaOqj4Z1DGOc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0EP+NX0BFVNgRJecxkiojmdn4SmuxlNK3evvGjtS3IuXAd5lRmkxoEAj1DNCEIORL 0oxOhnCJapbfE1z66DJpM/jiMCFTEXdo5CtmH8dw0+1DOc+l8JedxuduZ8KElCVKc1 +Ad3ly447unj1T1usWN5nZV0QFvGPif3Dmkm5OdA= 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.19 220/239] net/fsl: xgmac_mdio: Fix incorrect iounmap when removing module Date: Mon, 24 Jan 2022 19:44:18 +0100 Message-Id: <20220124183950.104279032@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183943.102762895@linuxfoundation.org> References: <20220124183943.102762895@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;