All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oarora Etimis <oaroraetimis@gmail.com>
To: Louis Chauvet <louis.chauvet@bootlin.com>,
	 Haneen Mohammed <hamohammed.sa@gmail.com>,
	Simona Vetter <simona@ffwll.ch>,
	 Melissa Wen <melissa.srw@gmail.com>,
	 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	 Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	 David Airlie <airlied@gmail.com>, Alex Hung <alex.hung@amd.com>,
	 Robert Mader <robert.mader@collabora.com>,
	 Harry Wentland <harry.wentland@amd.com>,
	Simon Ser <contact@emersion.fr>,
	 Daniel Stone <daniels@collabora.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/7] drm/vkms: free the colorop whose initialization failed
Date: Sat, 28 Nov 2026 18:15:20 +0100	[thread overview]
Message-ID: <20261128-colorop-v1-2-dd79919f822b@gmail.com> (raw)
In-Reply-To: <20261128-colorop-v1-0-dd79919f822b@gmail.com>

The error path of vkms_initialize_color_pipeline() walks ops[0..i-1],
but ops[i] is already allocated when its drm_plane_colorop_*_init()
call fails, so it leaks.

Include it in the walk.

Fixes: c1e578bd08da ("drm/vkms: Add enumerated 1D curve colorop")

Signed-off-by: Oarora Etimis <oaroraetimis@gmail.com>
---
 drivers/gpu/drm/vkms/vkms_colorop.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/vkms/vkms_colorop.c b/drivers/gpu/drm/vkms/vkms_colorop.c
index 9424b1994239..ed557a1c6a05 100644
--- a/drivers/gpu/drm/vkms/vkms_colorop.c
+++ b/drivers/gpu/drm/vkms/vkms_colorop.c
@@ -126,7 +126,7 @@ static int vkms_initialize_color_pipeline(struct drm_plane *plane, struct drm_pr
 	return 0;
 
 cleanup:
-	for (j = 0; j < i; j++) {
+	for (j = 0; j <= i && j < ARRAY_SIZE(ops); j++) {
 		if (ops[j]) {
 			drm_colorop_cleanup(ops[j]);
 			kfree(ops[j]);

-- 
2.56.1


  parent reply	other threads:[~2026-11-28 17:16 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-28 17:15 [PATCH 0/7] drm/vkms: complete the plane color pipeline Oarora Etimis
2026-11-28 17:15 ` [PATCH 1/7] drm/vkms: add the colorops of a plane that is being enabled Oarora Etimis
2026-11-28 17:15 ` Oarora Etimis [this message]
2026-11-28 17:27   ` [PATCH 2/7] drm/vkms: free the colorop whose initialization failed sashiko-bot
2026-11-28 17:15 ` [PATCH 3/7] drm/vkms: use the colorop states of the state being composed Oarora Etimis
2026-11-28 17:31   ` sashiko-bot
2026-11-28 17:15 ` [PATCH 4/7] drm/vkms: add a programmable 1D LUT colorop Oarora Etimis
2026-11-28 17:25   ` sashiko-bot
2026-11-28 17:15 ` [PATCH 5/7] drm/vkms: add a 3D " Oarora Etimis
2026-11-28 17:34   ` sashiko-bot
2026-11-28 17:15 ` [PATCH 6/7] drm/vkms: add a multiplier colorop Oarora Etimis
2026-11-28 17:31   ` sashiko-bot
2026-11-28 17:15 ` [PATCH 7/7] drm/vkms: add KUnit coverage for the 3D LUT and multiplier colorops Oarora Etimis
2026-11-29 12:37 ` [PATCH 0/7] drm/vkms: complete the plane color pipeline Louis Chauvet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261128-colorop-v1-2-dd79919f822b@gmail.com \
    --to=oaroraetimis@gmail.com \
    --cc=airlied@gmail.com \
    --cc=alex.hung@amd.com \
    --cc=contact@emersion.fr \
    --cc=daniels@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hamohammed.sa@gmail.com \
    --cc=harry.wentland@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=louis.chauvet@bootlin.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=melissa.srw@gmail.com \
    --cc=mripard@kernel.org \
    --cc=robert.mader@collabora.com \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.