Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp343836pxu; Thu, 7 Jan 2021 06:33:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJx9yjtfOt6yv2BJcuPux109LNeyuxbsde/s+W3UMT8Bc5DhY82UU0s7/H3xE+waRhc94rHZ X-Received: by 2002:a17:906:eca9:: with SMTP id qh9mr6790112ejb.188.1610030037958; Thu, 07 Jan 2021 06:33:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610030037; cv=none; d=google.com; s=arc-20160816; b=aun4zPDxonJb1Uk7WK4F/ZMSSs67knUuPKZ3hU80w+p26tZulNkKS6OrWqguDf2DHq nuTfT6+dpOM6uVLVQ2FgvVDNRgeXOgfzbErQezPwhSDwPOCcVjhnLudGyz7cOzLpRaql tHNuXWgta/+KQMe6tzZacDJvl3KpJWV2PRJc5crW6kVPhq5BLuHmGimTZo8phbqsTPWt 7HH3079fwKcB/3xMLB9NK/0ZDLNWevvlIWn+GY8wP1W1NToEvyxSrSffDLVhYX8dgFgE djl6SYQ8MNYkZM8m+Jp+2sTVVxnaqHXyO704Cv/M13wrKuMqKCWKpMDXDmU7MT1j3Sb+ Hg/Q== 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=LYbnc2iGBBYEeOi+DyiwePx8s5rJlvJEhIhuCE42mwc=; b=nqZ8NKVcJTduY34918TqoSbEXxsKfDHE1cNFZcl4+ZpXzaJxhuZbQYgz8+LySXxiij nlMqp2o3iQ0CUMSyBT6vthYsZyETGbKSZjz9IL7hjnWP+nZtTUIu8fI0HSiUBllhGMm0 chhMUNbSoDkJJUeyuewG0xtYcwoar1VUaSxD1JCfhNNcp9ND/WE/jC3jdWctfdLTZdKJ QhFL3YF+Rb47F3uImfuwrgbq/Z9yyYQuGlm/WXNEAL6DDRkk0s8s5IFC9w3dtn5eaC1g KBghDvRBd/AaSRdm8t6atAUP8uDIWOBsFpDJgE7E3DiryKya3EGAseMTTj1o0c0pd55z wiuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Yc0Fp64b; 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 f19si1576666ejf.221.2021.01.07.06.33.34; Thu, 07 Jan 2021 06:33:57 -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=Yc0Fp64b; 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 S1728964AbhAGObm (ORCPT + 99 others); Thu, 7 Jan 2021 09:31:42 -0500 Received: from mail.kernel.org ([198.145.29.99]:45348 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728873AbhAGObi (ORCPT ); Thu, 7 Jan 2021 09:31:38 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7F3CB2339E; Thu, 7 Jan 2021 14:31:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610029863; bh=bDaH0qxvKMZ3wwj/g24R05lfirUzzJc70cmssiyJNZU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Yc0Fp64bkmd6857FE9Ft+PmVPMviYcegIoSjnZ9WLkqXpe3871UgNZQ5B3YfdPiKO xotYvO+5O2runOLKAqpy3DzTbyPcxUmDEjbTgWG77Vf9Pvv0T4Z5EhBc4+vZmVy7DH 275Tj+j8Gc4J3f8zuKlt4kgEqqHkNIG7AQjlqzWU= 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 4.14 22/29] powerpc: sysdev: add missing iounmap() on error in mpic_msgr_probe() Date: Thu, 7 Jan 2021 15:31:37 +0100 Message-Id: <20210107143056.114499958@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210107143052.973437064@linuxfoundation.org> References: <20210107143052.973437064@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 280e964e1aa88..497e86cfb12e0 100644 --- a/arch/powerpc/sysdev/mpic_msgr.c +++ b/arch/powerpc/sysdev/mpic_msgr.c @@ -196,7 +196,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