Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3548261pxb; Mon, 24 Jan 2022 11:58:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJwdWITfeLbIDsJ32Uaxgx+41noIBuRLL8I1ru8PtUmPG1WvCZU7MWCYL1T+XffSqQFTBBOH X-Received: by 2002:a17:90b:1801:: with SMTP id lw1mr3396626pjb.215.1643054305890; Mon, 24 Jan 2022 11:58:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643054305; cv=none; d=google.com; s=arc-20160816; b=D74nB/PaYX/Z+LTEmspeKSgm2LvQY/w9DGEdFKPtKAVVkCHCMrIt6hZ3qOM1uqwJ1F kIFqhBhjyXXLJ8P71Yao+JmxxvqUMJkTQ81YyzAyfOpWb2ans+OkKwUIw0PRAnYomEIY O6pH/gMoMEWefZSzINAqbXWKx1/TBajV+EGAc1lzVCYpBM0Up6L4ZkLAyVVNCC6Ts6Es Xxdu9Y0n65MvigviHM0sYDgkTBXfDKEg3VpQGItEs1fCRHyeR+UFz3nHR2Urrm9Dy+DW OrvdCvxImeKn237U3u9aOQcfnHxRbirpLEZ4rtajskKeTC24YusAYI1Tmm9iU3OGOt+H i8Nw== 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=TAmZ/K019gLLbw2prqb7NhPI0B64XoaZRGCBK0wF2o4=; b=bo72x4hX2FyPTTnQzbSli1WaVLqm9D4PnZj546mc9IrUAwUK2udWg7Y8wNnckmPXyI a+619twakIKKfS9x9TC3V7dxcw+dKeKO12Z2DoPKlA58jDqiFFtzgtJdKQ6WIXfJT5eQ WXGPRyaWDVS93F6qifTq2tcIhQPhD0yKHN8q1UdhTM/4hUbgERmPzMh3VVnwsi+9btUA xT5so8GIUgAXJbtNBS1tNiawp4sNUAR1V+4cNOJQY2yxdJTfmqufUNQrKVTiAeUbzMhH GaWamiaiTuon1K+5ctvPOCNO5P7DSYnzIhRg8tm+PbyhYWoPfr/8+a6BfOp41qHQCTOZ No+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eKrsa0gE; 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 k10si16663445pfc.213.2022.01.24.11.58.13; Mon, 24 Jan 2022 11:58:25 -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=eKrsa0gE; 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 S1344134AbiAXSz6 (ORCPT + 99 others); Mon, 24 Jan 2022 13:55:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344191AbiAXSxz (ORCPT ); Mon, 24 Jan 2022 13:53:55 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2406EC06176A; Mon, 24 Jan 2022 10:53:08 -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 ams.source.kernel.org (Postfix) with ESMTPS id BC3D4B8121F; Mon, 24 Jan 2022 18:53:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CC749C340E8; Mon, 24 Jan 2022 18:53:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643050386; bh=FIqYHvH6IqcIa7qor3u4vpchq2nShExahI2dprWf424=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eKrsa0gEhQEMYAuxOPM2+zhjDzPRpCoszb6SBUORiwAvEaawA+6UvQSVRAp1nfqGi pcYAghX617Ng3b5poJGpdbZtomydyrRVGSJxTolgxO3enm89ZWAuP7aePI99hxXzBN 5DhlrHPoE5ebCTGi09J5a5dycZhzFmU/urlAXDE0= 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.4 102/114] net/fsl: xgmac_mdio: Fix incorrect iounmap when removing module Date: Mon, 24 Jan 2022 19:43:17 +0100 Message-Id: <20220124183930.260689505@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183927.095545464@linuxfoundation.org> References: <20220124183927.095545464@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 @@ -304,9 +304,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;