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 65A5A1170E for ; Mon, 11 Sep 2023 14:18:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D35E8C433C8; Mon, 11 Sep 2023 14:18:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1694441903; bh=uXBtynDVwS2TC+z/p5LGGKxpUJMF8/uBxlC7bX/XkA4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O1pMCfbp2Tutm3mt/UOqhDPFj5MHLIrljK/Al69SjJM+i/6GftvICXWbI37pbk6Er u6hZ6RtHW2ToklRQ9kyYuaCAR3n9vcFLyNPCiWhONNLbb6cb6V6Tz9hm+fkVFhIZ6S YfZ4YXHgPzVjl7kPJuE2IfGe3YHtKqsV60hEFX7k= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Peng Fan , Andy Shevchenko , Sasha Levin Subject: [PATCH 6.5 576/739] amba: bus: fix refcount leak Date: Mon, 11 Sep 2023 15:46:15 +0200 Message-ID: <20230911134707.194926194@linuxfoundation.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230911134650.921299741@linuxfoundation.org> References: <20230911134650.921299741@linuxfoundation.org> User-Agent: quilt/0.67 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.5-stable review patch. If anyone has any objections, please let me know. ------------------ From: Peng Fan [ Upstream commit e312cbdc11305568554a9e18a2ea5c2492c183f3 ] commit 5de1540b7bc4 ("drivers/amba: create devices from device tree") increases the refcount of of_node, but not releases it in amba_device_release, so there is refcount leak. By using of_node_put to avoid refcount leak. Fixes: 5de1540b7bc4 ("drivers/amba: create devices from device tree") Signed-off-by: Peng Fan Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230821023928.3324283-1-peng.fan@oss.nxp.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/amba/bus.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c index ce88af9eb562f..09e72967b8abf 100644 --- a/drivers/amba/bus.c +++ b/drivers/amba/bus.c @@ -528,6 +528,7 @@ static void amba_device_release(struct device *dev) { struct amba_device *d = to_amba_device(dev); + of_node_put(d->dev.of_node); if (d->res.parent) release_resource(&d->res); mutex_destroy(&d->periphid_lock); -- 2.40.1