Received: from mta.al2klimov.de (mta.al2klimov.de [162.55.223.79]) (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 3BEA038C42D for ; Tue, 26 May 2026 18:41:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=162.55.223.79 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779820899; cv=none; b=G6OutyRLTZ1Jr00c/vMoKq+VywwY2JRRp5bTI+UhxX5WVKry6RfZ+v/Y9JpvFHmPC/LnS7pCKDNLj26z6KN5QkXkTNsDdK44ELlZWEJx4/F5iFtzdC6d6uuVv9w+7ezyTQ/hO6cNe7Wxt3ziNmhyrAmyW2f3l8KQPIJ3rXf00BY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779820899; c=relaxed/simple; bh=RGr9RhUj9VyYa/VKi4G+Ov+L/sjvoypdIkfSngXCuGo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ESs4/mTq+wJOy0loPDD4vakAZy2IOv0+DOZC6CJGCZoTZGyQwarv54glE4PwGiwD1EC/pvKVUi5TKY7XWRVR7pHwUcdoMKyKgLnT07mq33jq0DKmsZD4+kTExzjPzKQ0dxMFJa55Mrrf4mgXOLFwpNUGXfyApy00/2SqHUExLPI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=al2klimov.de; spf=pass smtp.mailfrom=al2klimov.de; dkim=pass (2048-bit key) header.d=al2klimov.de header.i=@al2klimov.de header.b=NqL2HBfZ; arc=none smtp.client-ip=162.55.223.79 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=al2klimov.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=al2klimov.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=al2klimov.de header.i=@al2klimov.de header.b="NqL2HBfZ" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=default; bh=RGr9RhUj9VyY a/VKi4G+Ov+L/sjvoypdIkfSngXCuGo=; h=references:in-reply-to:date: subject:cc:to:from; d=al2klimov.de; b=NqL2HBfZt2DCdNGeM1a53Xfhgt3wNgx0 cbz3jlbYYMTZYzK09T3m9wtqJjuMJcRMxeiva8jI3wthwQL1cOfYHIiYq1O0gLR1UrFp3N C/0TGsrXKNoD+mUwMUtUPwggiqk2OzWNS4lSgA209ldzvGlkbqmh3Iz6WauKytPsyuUhUY 5N3J8Wno5WIM7HU8aSA9LJkPV4kxljtuQdka6BMUCTNMQxDWp9a0lX3v7m/iVQIspfiaPl G5zxgpRjXl691cmR9GtSZDiRosx6kPR6IBbxAMFiL298VcWNo09rEFgPsgdh4jYIm2Qcha /nZazaHjRo6Wz9un03nU9FZ2LHxwlw== Received: from cachy-ak (88.215.123.80.dyn.pyur.net [88.215.123.80]) by mta.al2klimov.de (OpenSMTPD) with ESMTPSA id d8e6d6e9 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Tue, 26 May 2026 18:41:28 +0000 (UTC) From: "Alexander A. Klimov" To: Daniel Lezcano , Thomas Gleixner , Arnd Bergmann , Alexander Shiyan , linux-kernel@vger.kernel.org (open list:CLOCKSOURCE, CLOCKEVENT DRIVERS) Cc: "Alexander A. Klimov" Subject: [PATCH] clocksource/drivers/clps711x: fix refcount leak Date: Tue, 26 May 2026 20:40:57 +0200 Message-ID: <20260526184105.18962-2-grandmaster@al2klimov.de> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260526184105.18962-1-grandmaster@al2klimov.de> References: <20260526184105.18962-1-grandmaster@al2klimov.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Every value returned from of_clk_get() is supposed to be cleaned up via clk_put() once not needed anymore. Fixes: f0b7fabec327 ("clocksource: clps711x: Add CLPS711X clocksource driver") Signed-off-by: Alexander A. Klimov --- drivers/clocksource/clps711x-timer.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/clocksource/clps711x-timer.c b/drivers/clocksource/clps711x-timer.c index bb0a44adaf28..d9298a5f6005 100644 --- a/drivers/clocksource/clps711x-timer.c +++ b/drivers/clocksource/clps711x-timer.c @@ -76,7 +76,7 @@ static int __init _clps711x_clkevt_init(struct clk *clock, void __iomem *base, static int __init clps711x_timer_init(struct device_node *np) { unsigned int irq = irq_of_parse_and_map(np, 0); - struct clk *clock = of_clk_get(np, 0); + struct clk *clock; void __iomem *base = of_iomap(np, 0); int ret = 0; @@ -86,6 +86,8 @@ static int __init clps711x_timer_init(struct device_node *np) ret = -EINVAL; goto unmap_io; } + + clock = of_clk_get(np, 0); if (IS_ERR(clock)) { ret = PTR_ERR(clock); goto unmap_io; @@ -103,6 +105,7 @@ static int __init clps711x_timer_init(struct device_node *np) break; } + clk_put(clock); unmap_io: iounmap(base); return ret; -- 2.54.0