Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp724354pxb; Fri, 21 Jan 2022 01:35:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJxifNuYnAHUWAADIVCSLDlCAEw78U4/HyX1U4ygXo/4aRLBdLzY2PJgtjIrdJ7+wIUQ6HPZ X-Received: by 2002:a17:902:dac7:b0:14a:537b:db2a with SMTP id q7-20020a170902dac700b0014a537bdb2amr2959728plx.3.1642757717244; Fri, 21 Jan 2022 01:35:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642757717; cv=none; d=google.com; s=arc-20160816; b=PIOvby/FWznNx/9Zg9vHsHfx4r3faPQaxuapOHVvgKK0wCXiJq6yThqCK8bIqB7txX MbTFz1wPDlmUNiH0iFEqO6aXe96abG2zq0Di/uDEcKjW7g+NDMluPgJGca+Yh1gnOPop Z4zq4AbPvOkeMPqL+DoIQVCikpDht2qW0qCr42U86cN3z+X6LTAk3ob0QAvlFVpBzdNT Gm/fquRzZ72kAJZUwRCehBTQSj0H656sIaYWZAOwtGpCWDWdjGDOxhmgiiuaagGQJRBT 8lXOmCjLff5Svye92SMKTCO7wDqkx4kjm3qzJ5URE/zgWbSIgsawqGT97h77hbpCFWlR WWFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:organization :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=JeYoWwfchvNJOmrZgHyYDokoWzu/xjtZKfF1uxEPiY0=; b=lMf95VSEZiB3qSFtHSAy+hQ5T1IANA1aY8P3sKsZS55fQf9gQlYgWE2obBdkw1nNpw s9+LY/RTWA07MM2Gmpqlcni7bTnekarP8QHaSOeDP/qVy6fa7LLD0uCvPRVtS8EdZaRX TG+4276Eg0LsYN0mibXzcjIuhsxQzA0285O/3/Adba8MjDXMimrtV5K3E7R22pIxdLn7 qGxRQDmhDdZYZVixY+9PrednzR25mHTerqRTsYxJihb9LTPnlNTSq+82lh/l17vSwO94 T8cwrIJCz5xQGRVykulxzknU1IqXnONFcWGpzwhuIjZbNXb0x+g6rjiotZXUeatgtmXX EsKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@waldekranz-com.20210112.gappssmtp.com header.s=20210112 header.b=4PrA+f6B; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i3si2336774pgh.63.2022.01.21.01.34.58; Fri, 21 Jan 2022 01:35:17 -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=@waldekranz-com.20210112.gappssmtp.com header.s=20210112 header.b=4PrA+f6B; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349788AbiARVvU (ORCPT + 99 others); Tue, 18 Jan 2022 16:51:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349696AbiARVvN (ORCPT ); Tue, 18 Jan 2022 16:51:13 -0500 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA107C06161C for ; Tue, 18 Jan 2022 13:51:12 -0800 (PST) Received: by mail-lf1-x12f.google.com with SMTP id m1so959041lfq.4 for ; Tue, 18 Jan 2022 13:51:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=waldekranz-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:organization:content-transfer-encoding; bh=JeYoWwfchvNJOmrZgHyYDokoWzu/xjtZKfF1uxEPiY0=; b=4PrA+f6BhxoJRVWv4pzCCp7JcgyL+SZ4Hx2xPu+iqc8A34u9z7lX/pHyhw4ZVJ3DFt LbGrgWmC0g5mCDQAsOWOHwNYYYp4ADtFkqWRqC8zNoEACrugXDGqcCFbslSeGmaphapc VRoLdYETqUAuQ6ftH02tRJRcbUE7gh+LqMqgt8vHBSTJFJV1cWDRXYf5wWXhg4X66fMf yj7kyBw7Oei15CA4t4gjSgqEgim/yFU+OvSCLec/OdteG/CEtvdVKo6BJ6ihGUbBElNR XrQKNfC8Yn2lDXitCsoixlImwxs1QuCIdhPEceXSmTQz4ql/JsKktrwvbGP/aPIptWbj PaTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:organization:content-transfer-encoding; bh=JeYoWwfchvNJOmrZgHyYDokoWzu/xjtZKfF1uxEPiY0=; b=qGdR6lxPUWRoLv0VbVHHTXzEMrgiWB8KKHgfzVuNjZgvwuT3UPltK4kiWa5+tzJGSO ymhLyNdAkGUxZ5QMlH5CXCP9Sv68BfwKGkwR8/m8yMFJLXtKA08cDWH7q2hqOLw5le66 fzDEJVnoYtf42vZk9z4YDBKut9mHkgQfSum91aR57ge9EnPCVKth8mpp1e7VlGI7eZgW ygfHAqzF4S7hvMYgnG1yraSU9Eo1QDpgpiDck0QRZ1V1IClgm1d46qiPhI2TfvqIIg+o D1L+ox79ZwlFdw8ZrUKpBuy8YAtBg/CtKLCxbH9kqJ7YbjksuTkbyTnwQWM8LLxvI0OG kL8Q== X-Gm-Message-State: AOAM530SeY5WdbxK+zybpKsqMqsWX8AzeWpi/GOeS7nPe9Vh0f6PTomi gGEeoljHq2CvkWPnGGuxiwCwXA== X-Received: by 2002:ac2:531a:: with SMTP id c26mr22724055lfh.356.1642542671173; Tue, 18 Jan 2022 13:51:11 -0800 (PST) Received: from veiron.westermo.com (static-193-12-47-89.cust.tele2.se. [193.12.47.89]) by smtp.gmail.com with ESMTPSA id w5sm1704808ljm.55.2022.01.18.13.51.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jan 2022 13:51:10 -0800 (PST) From: Tobias Waldekranz To: davem@davemloft.net, kuba@kernel.org Cc: netdev@vger.kernel.org, Andrew Lunn , Timur Tabi , linux-kernel@vger.kernel.org Subject: [PATCH v2 net 4/4] net/fsl: xgmac_mdio: Fix incorrect iounmap when removing module Date: Tue, 18 Jan 2022 22:50:53 +0100 Message-Id: <20220118215054.2629314-5-tobias@waldekranz.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220118215054.2629314-1-tobias@waldekranz.com> References: <20220118215054.2629314-1-tobias@waldekranz.com> MIME-Version: 1.0 Organization: Westermo Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/net/ethernet/freescale/xgmac_mdio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/freescale/xgmac_mdio.c b/drivers/net/ethernet/freescale/xgmac_mdio.c index bf566ac3195b..266e562bd67a 100644 --- a/drivers/net/ethernet/freescale/xgmac_mdio.c +++ b/drivers/net/ethernet/freescale/xgmac_mdio.c @@ -331,9 +331,10 @@ static int xgmac_mdio_probe(struct platform_device *pdev) 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; -- 2.25.1