From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F1F8F1D0E1F; Wed, 2 Oct 2024 14:30:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727879405; cv=none; b=LW8M81KK/w2N9PkMGO5Yy23Z2zn6xcAOynSRhsjOK4QJa52P9g8kpYG242TDWVrqyeFfnEf3yWoaNSqLtRTxikXD7j53/0zWzz80bIYYHgQumbrF1S4YCi5iwYkiY+LKzZ2qyKgII2AWIkRBfFMFaZK43gQNJ8W6J9UYSmKBYoc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727879405; c=relaxed/simple; bh=XOomanUaMhFy1A8d++BV1CrDShflPnI1oNEFo6dFb/A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=r6narMfLtnmkBaA8EjQQbSD30NKlgP0rLPPVGdGHfLfxz5943bMkXxtbdkeNlsA7TJ47/3zUTjbscRNsxo26+j3sApaJIHxPXTOvmnRAHHUppAhd9xdL5Es8jkXWHN7yiSHGapz6tIIbAz2Gol2GbsAZPXUEJLdfqr/Xm6nmzR0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=pi2vNDz1; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="pi2vNDz1" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 744DEC4CEC2; Wed, 2 Oct 2024 14:30:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1727879404; bh=XOomanUaMhFy1A8d++BV1CrDShflPnI1oNEFo6dFb/A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pi2vNDz1dWxXyvJIHEp2TrzsnUfgIoyV3xnHVkf+Jd79ZrSQ9Krfn2Zv6ih51/wme AnGJKLRuTomj5wDG72bi8HSObZmaKjx33Rov+c39yl4XYfry/TQ7X/tYr4c1akjkvf wwEEIkBf37BhkNFKtNk1JUyNoiUpxuDN1quyepfE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Ankit Agrawal , Konrad Dybcio , Daniel Lezcano , Sasha Levin Subject: [PATCH 6.6 108/538] clocksource/drivers/qcom: Add missing iounmap() on errors in msm_dt_timer_init() Date: Wed, 2 Oct 2024 14:55:47 +0200 Message-ID: <20241002125756.494520334@linuxfoundation.org> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241002125751.964700919@linuxfoundation.org> References: <20241002125751.964700919@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ankit Agrawal [ Upstream commit ca140a0dc0a18acd4653b56db211fec9b2339986 ] Add the missing iounmap() when clock frequency fails to get read by the of_property_read_u32() call, or if the call to msm_timer_init() fails. Fixes: 6e3321631ac2 ("ARM: msm: Add DT support to msm_timer") Signed-off-by: Ankit Agrawal Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20240713095713.GA430091@bnew-VirtualBox Signed-off-by: Daniel Lezcano Signed-off-by: Sasha Levin --- drivers/clocksource/timer-qcom.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/clocksource/timer-qcom.c b/drivers/clocksource/timer-qcom.c index b4afe3a675835..eac4c95c6127f 100644 --- a/drivers/clocksource/timer-qcom.c +++ b/drivers/clocksource/timer-qcom.c @@ -233,6 +233,7 @@ static int __init msm_dt_timer_init(struct device_node *np) } if (of_property_read_u32(np, "clock-frequency", &freq)) { + iounmap(cpu0_base); pr_err("Unknown frequency\n"); return -EINVAL; } @@ -243,7 +244,11 @@ static int __init msm_dt_timer_init(struct device_node *np) freq /= 4; writel_relaxed(DGT_CLK_CTL_DIV_4, source_base + DGT_CLK_CTL); - return msm_timer_init(freq, 32, irq, !!percpu_offset); + ret = msm_timer_init(freq, 32, irq, !!percpu_offset); + if (ret) + iounmap(cpu0_base); + + return ret; } TIMER_OF_DECLARE(kpss_timer, "qcom,kpss-timer", msm_dt_timer_init); TIMER_OF_DECLARE(scss_timer, "qcom,scss-timer", msm_dt_timer_init); -- 2.43.0