Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp13951612pxu; Mon, 4 Jan 2021 08:49:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJx04ozVS+TPgy1zpAUjFOJtQ1th0r1eS3U5SWfvrmeppqvjg6n7VwFupewCyBhlsXemklB+ X-Received: by 2002:a05:6402:100c:: with SMTP id c12mr74163087edu.356.1609778949626; Mon, 04 Jan 2021 08:49:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609778949; cv=none; d=google.com; s=arc-20160816; b=n5LwcImsKfi3fz0YGtp9TtPBSxnu5y3fmtgzNoR9itb7FNqiKQzBuio5oyJc1Jx5ht MZSIZSotWhqf+PA8x0Qt2UvBMSE95rpJBH9d5aztFmuIw3Q1/BM8nXdX7KtbhniowTJe I+etEa52d0rqi7FQ1wj/unAMk9ESEj4JCRaZ2DYd6SIrQ91kH24MvKNcJH996c7gredB n4ew4ivXb8mgpTn+qZZ4xg78e/BQhDqzGwXpIG3n+WVdN57Ua2SZFu6mkSeCvzcEJgMv ZVRchdIfVuQ5RgBTdRyfRm3aEg/s9k0CatkIDHE505Gle6QBI/+PvH2kmBz5ErJOvfFP v16A== 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=bymWcJ8qnVn4twYYXRTvUfKMIUoHXD8JOlBiHiR3NEM=; b=SV5fwRhZLTAArgfqtKWIb4fEKiAQjn1++MnRvZo6+/S1Of6/yDnI7z2d2KbsEiAJcS B+lmsN+4P0NeGBtZabE36KLK8N5yYll2ttSbLHf/rqC941XaSgVxnR0VurPpMyrjBPcZ mFXtOgZf/PWZGQ+3JUxiN0NGPx0cod22M1zR6FQWWd0GKoCA5W2GFRUzSPEzQu8BSKb2 AQCWTdU3VwnBKOzwIxTPfaZaB1R76ZCLW6ubRYFctYeQ35h/FeWlLRmWVCKX9e6es6bB lFz9COyen5Cgi/J4kKpkyJGNXljkJ52QwnL7VpC6DXLu6221lHrXpKw+Oey5GdLrfWVM wVcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ljPCR5Ft; 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 cb23si32445963edb.75.2021.01.04.08.48.46; Mon, 04 Jan 2021 08:49:09 -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=ljPCR5Ft; 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 S1728515AbhADQBN (ORCPT + 99 others); Mon, 4 Jan 2021 11:01:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:38400 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727785AbhADQBM (ORCPT ); Mon, 4 Jan 2021 11:01:12 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 306C02245C; Mon, 4 Jan 2021 16:00:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609776031; bh=xCZw4h1gUVy5W+RXm5Qkfjq27sAVjQQ4+42yUPxqyMY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ljPCR5FtqFK8TZVU5qIQbLLY5053BhL8g2MXkp+SYFqucspBlaLVyXUXsdXI8pRrg V3pAEjd/K7XsBH00dpFHHFuX2SMO1qp491y7La6sv9wCV2P8IeWTFVoxjJCCrnjEn/ oCIW0rQhNhZKc3PzwJzPLCgqbSRk42tlFruk9XlA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Qinglang Miao , Michael Ellerman , Sasha Levin Subject: [PATCH 5.4 38/47] powerpc: sysdev: add missing iounmap() on error in mpic_msgr_probe() Date: Mon, 4 Jan 2021 16:57:37 +0100 Message-Id: <20210104155707.575016961@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210104155705.740576914@linuxfoundation.org> References: <20210104155705.740576914@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: Qinglang Miao [ Upstream commit ffa1797040c5da391859a9556be7b735acbe1242 ] I noticed that iounmap() of msgr_block_addr before return from mpic_msgr_probe() in the error handling case is missing. So use devm_ioremap() instead of just ioremap() when remapping the message register block, so the mapping will be automatically released on probe failure. Signed-off-by: Qinglang Miao Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20201028091551.136400-1-miaoqinglang@huawei.com Signed-off-by: Sasha Levin --- arch/powerpc/sysdev/mpic_msgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/sysdev/mpic_msgr.c b/arch/powerpc/sysdev/mpic_msgr.c index f6b253e2be409..36ec0bdd8b63c 100644 --- a/arch/powerpc/sysdev/mpic_msgr.c +++ b/arch/powerpc/sysdev/mpic_msgr.c @@ -191,7 +191,7 @@ static int mpic_msgr_probe(struct platform_device *dev) /* IO map the message register block. */ of_address_to_resource(np, 0, &rsrc); - msgr_block_addr = ioremap(rsrc.start, resource_size(&rsrc)); + msgr_block_addr = devm_ioremap(&dev->dev, rsrc.start, resource_size(&rsrc)); if (!msgr_block_addr) { dev_err(&dev->dev, "Failed to iomap MPIC message registers"); return -EFAULT; -- 2.27.0