Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3977195pxb; Tue, 25 Jan 2022 00:28:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJwTULQ3E8EYFfD1DYKXfjgED2a4kuZqpiHXLJGq7SipAYddNdARM8l1jyXvkbqsjoIxMr7/ X-Received: by 2002:a17:903:124c:b0:14a:83bf:52ec with SMTP id u12-20020a170903124c00b0014a83bf52ecmr17630935plh.124.1643099288396; Tue, 25 Jan 2022 00:28:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643099288; cv=none; d=google.com; s=arc-20160816; b=U5nQ52jrRwfF17ilAJevsFT/LMFLqlUPDprfo+bkiTBwBncvkVYT66HhKjVpMfT65m NypZCoDWl8Ij3jBXmcWq/xNMhlmMEdlbeZkyIwjcENpSsX2UwV9dAZ5L1PvB0u0TzNXg nyApRXwzQimCiE0+ZjrmUu6npm+kYV36+FBC8oM64o840mT6RLPtHDP6+HAqBxN+xHps PPX6ZOoFdL5KxCMjl2Dqvmg9wgo4rNmp/TVozjEieL0W/jq3BWz3VDOaiw13WlEF1nc6 C42o3glz3n5ZJUJ5Z9UwWYbsKH9xG+zCZUJTBIJzQ8tHpHvI6mirvdQlmW/VXnscFu5K mOIg== 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=GcKtUFihm2WNwovgxwKHdxQzVBEYxgcouHGtOsbsgRt5E+EQ0/So2u3mNBZRgMvq6I DoUCwd5XtVR+FajxOGuuWFjrWlYp4X5emHV8z6rm2jMjLICxy20mtcJ30VnE6B4f9Za8 t8OcsBHJex+z5QeVUQIuKpjqrWfO6RxOlN1IOkJmKiOjNPelRxrlPKZxlGvCkUpQbZNr w52IaUEAxo/10TJYJlDgOIB7J9rP0Umkwq5RFccjRUFpn1IUII/H4VnTXyIqUgJC7MHQ nTbVUElnMclG9CMT89V7eSOLoS6ACcfU3rhutl/UiynwGenO67eA2dVz7Rmeii5WO3Kj vaFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jT23P5FP; 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 r20si13899016pgu.89.2022.01.25.00.27.56; Tue, 25 Jan 2022 00:28:08 -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=jT23P5FP; 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 S3423008AbiAYCcp (ORCPT + 99 others); Mon, 24 Jan 2022 21:32:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355743AbiAXUWc (ORCPT ); Mon, 24 Jan 2022 15:22:32 -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 8B842C061250; Mon, 24 Jan 2022 11:10:49 -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 289E561299; Mon, 24 Jan 2022 19:10:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 35EF9C340E5; Mon, 24 Jan 2022 19:10:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643051448; bh=SkxgkeQKtRzsXP4qhrbvLWmh+8iL7PKLaOqj4Z1DGOc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jT23P5FPGh1qF4P4Yuxbobwt/G6xCYcOg63bICO+pkmVjecKMlV4uwPosQ22L8rur m99qkwdcGjL/mbsv2rYYnqGDCqJoV7qEE4peFibE6nLU9ibE+lU1e+ewUvQOBWGZOy QQJVTCL8hgERzVFq40a2JNLp+ZXfkbqu6pgONAyQ= 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.14 165/186] net/fsl: xgmac_mdio: Fix incorrect iounmap when removing module Date: Mon, 24 Jan 2022 19:44:00 +0100 Message-Id: <20220124183942.423045708@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183937.101330125@linuxfoundation.org> References: <20220124183937.101330125@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;