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 4BE813AF667; Mon, 23 Mar 2026 14:12:14 +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=1774275134; cv=none; b=daXynEfSFSjPYZF6lxtyy8MfMGY04njs+zobZ15OJ6dipb3o70ssT8p6GXWhqK3TDb0Lf+tXxN8Yzb+bhD4T/sTFLLsdxy+td5HV347fjTcdaHXb+ecdX0AOIeWw+BCBbp7tBQBpk29OM/l9s4n5bUlJllvvXFZaxSeKlmxe7co= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774275134; c=relaxed/simple; bh=/XpHZjgZc80ZV0zUsGX939EqaING1NTffTXuuk8moBY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PheXzXj5+My/3OGgBNDGAf3M/XSHRalmLN3sdpGmxe4hkBHcBD/Ra1zt9YofLZKWCtwZtBUTSp+s7SSJuKhtUGj1WYbmkodSNh7fv7gj7JAtFbyCANgcrVaAZLCK4zHqRtUrGPOVwIpXNr6TYkmZl0yUhLkVdBQgFiCVoTAEpsg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=paOql4eu; 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="paOql4eu" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C1EA7C4CEF7; Mon, 23 Mar 2026 14:12:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1774275134; bh=/XpHZjgZc80ZV0zUsGX939EqaING1NTffTXuuk8moBY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=paOql4euzWb4P5PKFbvvYRNQyPXE5gL4gozRdxmE70XWkto5HhT2mTvqq1MHThJl5 xyV29sJYpwtNWcQNcJqhLAe6IK8q6bsfQ4z6brgEz5i/OAgv59H9l7vZvmSMT95Df8 vC1HCnZgCtslhJId4iFYaxShv/bjxZ9hkfdUeoNE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Felix Gu , Luca Ceresoli , Kory Maincent , Sasha Levin Subject: [PATCH 6.6 003/567] drm/logicvc: Fix device node reference leak in logicvc_drm_config_parse() Date: Mon, 23 Mar 2026 14:38:43 +0100 Message-ID: <20260323134533.834090837@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260323134533.749096647@linuxfoundation.org> References: <20260323134533.749096647@linuxfoundation.org> User-Agent: quilt/0.69 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: Felix Gu [ Upstream commit fef0e649f8b42bdffe4a916dd46e1b1e9ad2f207 ] The logicvc_drm_config_parse() function calls of_get_child_by_name() to find the "layers" node but fails to release the reference, leading to a device node reference leak. Fix this by using the __free(device_node) cleanup attribute to automatic release the reference when the variable goes out of scope. Fixes: efeeaefe9be5 ("drm: Add support for the LogiCVC display controller") Signed-off-by: Felix Gu Reviewed-by: Luca Ceresoli Reviewed-by: Kory Maincent Link: https://patch.msgid.link/20260130-logicvc_drm-v1-1-04366463750c@gmail.com Signed-off-by: Luca Ceresoli Signed-off-by: Sasha Levin --- drivers/gpu/drm/logicvc/logicvc_drm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/logicvc/logicvc_drm.c b/drivers/gpu/drm/logicvc/logicvc_drm.c index 749debd3d6a57..df74572e6d2ea 100644 --- a/drivers/gpu/drm/logicvc/logicvc_drm.c +++ b/drivers/gpu/drm/logicvc/logicvc_drm.c @@ -90,7 +90,6 @@ static int logicvc_drm_config_parse(struct logicvc_drm *logicvc) struct device *dev = drm_dev->dev; struct device_node *of_node = dev->of_node; struct logicvc_drm_config *config = &logicvc->config; - struct device_node *layers_node; int ret; logicvc_of_property_parse_bool(of_node, LOGICVC_OF_PROPERTY_DITHERING, @@ -126,7 +125,8 @@ static int logicvc_drm_config_parse(struct logicvc_drm *logicvc) if (ret) return ret; - layers_node = of_get_child_by_name(of_node, "layers"); + struct device_node *layers_node __free(device_node) = + of_get_child_by_name(of_node, "layers"); if (!layers_node) { drm_err(drm_dev, "Missing non-optional layers node\n"); return -EINVAL; -- 2.51.0