Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3660537pxb; Mon, 24 Jan 2022 14:42:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJyv4U8gPcLVC6CcOeLoB0BGQl8AIBBwZjkvX2PTgWfB1FCOAMuxcsufl0deXd5oAFrxNypD X-Received: by 2002:a17:902:7ec1:b0:14b:7484:9876 with SMTP id p1-20020a1709027ec100b0014b74849876mr519282plb.90.1643064170015; Mon, 24 Jan 2022 14:42:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643064170; cv=none; d=google.com; s=arc-20160816; b=PI4WTAH0JGbyKnOe8N+L5ioUY6Js5ib6E6bafLQcfrP0N+VKFGAFqGXQ8UzeaE+iLc 6NuMZncbpciuFtkykf0OjzqQPwqjkMEmF/5QLCy7OffcYj3u0zi+Sjd2vK3jrFP0RGBS jNou6/EM98WduNcBfFRjNbwo4qZXDRFqZjsGtEz9sPXK9gHceWs+T5nwfRJdCTb+Z+q4 ootioAX+ZZr6f2lzJJQeYbnYtNnfda4yAslW8llXiJL8wcXIntZnZ7fvLWxtntUpFoFg l03j3bzEffguNWsuEM6wn9ItgC3tRS2vpcJX+hNKviuH+f13pm70K2BcVX4YQFCq4ZuO Yyww== 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=CSpmGvXkortQ/xgLlYt4ZFHD5tD2OZ4IwdsLxgL97dE=; b=0+jWEH2n9w1EXaODhJKjse0yZsq+Sl2imcw6cGsvIpcLirYApyyJaBjzzPRkGP7ZyB JbjGVxmcP3h9kr2+NpPNP/rVIjEg0Nd1t2kltgpiocDduSlHHGDPNriMfIuYDsB2djhL 1M6ad+Da9YxCUheYczXbV9D1wi13oGACM8EX/lsbbaHWudVjzmpSzYVbM5n2A8Cqonjh kgxD/V/JttbIzsYKfh9rMN8A9morMA3gFP1068bBTabmq0POXfG2bLbPEuNbB1dlAhWV OuTIJ9WiF+/OykYfHptQ1oyjxiKqXRLLbaGMLVfhkeGI3aAXRoVJpdamP27s3Rknmfjv S5kA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ie96XdMQ; 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 r11si12625096pgm.30.2022.01.24.14.42.37; Mon, 24 Jan 2022 14:42:50 -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=ie96XdMQ; 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 S1835642AbiAXWhF (ORCPT + 99 others); Mon, 24 Jan 2022 17:37:05 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:58780 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1456978AbiAXVki (ORCPT ); Mon, 24 Jan 2022 16:40:38 -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 A68686146A; Mon, 24 Jan 2022 21:40:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 707C8C340E4; Mon, 24 Jan 2022 21:40:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643060437; bh=y08BoJsvT23llfRHmxQAYEFNIoccmXlZdRTEGoZXIFk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ie96XdMQ08jK0+N3kPicPgaMJxrWeGGNi3ub5E5iI7IyNxTafQkv8n3wDNgPTfLer endsri4wfhmc/LgqMiqb5vFI+23fs4cA4V+Mv0In0dlpJKHn/JyW9PH6ePwFOC/1E0 Fm9Uf+TJMk/kfzn1wdqyIxiDUbUVFNhPjXQ6APX4= 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.16 0948/1039] net/fsl: xgmac_mdio: Fix incorrect iounmap when removing module Date: Mon, 24 Jan 2022 19:45:37 +0100 Message-Id: <20220124184157.157800630@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@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 @@ -331,9 +331,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;