From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 70BD2501285; Wed, 30 Sep 2026 16:46:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790786765; cv=none; b=OjXN+er3RO4knj6SaSAIV67qaXmF65+llciNalh3+SXuIhN99J8upYLrr5o2+N8DwtaO2iiYkXI4bG7xRFgJeTNOiyBmPdA+Tm6zx5IqGRG2VBAj7a3gjFQ+rXeNtwyWlukXOlvrp1ipW61/bJ3xb17iHuRNqIPKZGHZu85kJu8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790786765; c=relaxed/simple; bh=u9mPwrQs4oqNDC272kj5liBtWMyVizH5imOgS+slrhc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TBsU5wkp16mQgQ9St/ZcjlvcXvYCGS6QDB8wuTk0NYrpit/QrYnX0M9GjV+wBeTxseBTgj4fdGvJbo9oy9GYuG3Db+TaBxYGJb6LFw1iPnp7ZSi2GlTaErIaFbd2EZAEH1XEMJTpd1lBy1VtS0N06qn+sa5C13MxvKWwAQHZMXg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ExV4dx6x; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="ExV4dx6x" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CB6C11F000FF; Wed, 30 Sep 2026 16:46:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790786764; bh=6j/rCb1PWL/DS1qxOuZlKYz2ujkC/6dwGnjDAj9LDIE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ExV4dx6xbrSWTQeANwsBeqmv75gyejme+7eUk9gjpS8jhpCqGAco2QeHcks1L4fEv oAGNrvGS7l0a8IuIdwDA4QA0tjE1TB/waniYxfr+f/j8j4d6+TEd0TLapunMazJx5i ZwZujHlFQjc6Cu+6fbOCJTHUJI6uPHESogr0iZro= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Wentao Liang , Simon Horman , Paolo Abeni Subject: [PATCH 6.1 932/982] fsl/fman: Fix clk reference leak in read_dts_node() Date: Wed, 30 Sep 2026 17:27:48 +0200 Message-ID: <20260930152436.760422467@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260930152416.775402466@linuxfoundation.org> References: <20260930152416.775402466@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Wentao Liang commit a644f09b2090ad22a13fbcf9d141084f573108ef upstream. of_clk_get() returns a clock with its reference count incremented, but read_dts_node() only uses it to read the rate and never calls clk_put(). The clock is not stored anywhere, so the reference cannot be released later either. Release the clock once its rate has been read, which also covers the error path taken when the rate is zero. Fixes: 414fd46e7762 ("fsl/fman: Add FMan support") Cc: stable@vger.kernel.org Signed-off-by: Wentao Liang Reviewed-by: Simon Horman Link: https://patch.msgid.link/20260917110135.2148068-1-vulab@iscas.ac.cn Signed-off-by: Paolo Abeni Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/freescale/fman/fman.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/net/ethernet/freescale/fman/fman.c +++ b/drivers/net/ethernet/freescale/fman/fman.c @@ -2747,6 +2747,7 @@ static struct fman *read_dts_node(struct } clk_rate = clk_get_rate(clk); + clk_put(clk); if (!clk_rate) { err = -EINVAL; dev_err(&of_dev->dev, "%s: Failed to determine FM%d clock rate\n",