All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH next] drm/plane: Fix error pointer vs NULL bug in create_in_format_blob()
@ 2025-05-23 16:07 Dan Carpenter
  2025-05-23 21:46 ` Dmitry Baryshkov
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2025-05-23 16:07 UTC (permalink / raw)
  To: Arun R Murthy
  Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, Chaitanya Kumar Borah, Harry Wentland,
	Suraj Kandpal, Ville Syrjälä, Xaver Hugl, dri-devel,
	linux-kernel, kernel-janitors

The callers expect to receive error pointers on error but
create_in_format_blob() returns NULL.  Change it to return error
pointers.

Fixes: 0d6dcd741c26 ("drm/plane: modify create_in_formats to acommodate async")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 drivers/gpu/drm/drm_plane.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c
index 04992dfd4c79..75a7e8aa6611 100644
--- a/drivers/gpu/drm/drm_plane.c
+++ b/drivers/gpu/drm/drm_plane.c
@@ -209,7 +209,7 @@ static struct drm_property_blob *create_in_format_blob(struct drm_device *dev,
 	formats_size = sizeof(__u32) * plane->format_count;
 	if (WARN_ON(!formats_size)) {
 		/* 0 formats are never expected */
-		return 0;
+		return ERR_PTR(-EINVAL);
 	}
 
 	modifiers_size =
@@ -225,7 +225,7 @@ static struct drm_property_blob *create_in_format_blob(struct drm_device *dev,
 
 	blob = drm_property_create_blob(dev, blob_size, NULL);
 	if (IS_ERR(blob))
-		return NULL;
+		return blob;
 
 	blob_data = blob->data;
 	blob_data->version = FORMAT_BLOB_CURRENT;
-- 
2.47.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH next] drm/plane: Fix error pointer vs NULL bug in create_in_format_blob()
  2025-05-23 16:07 [PATCH next] drm/plane: Fix error pointer vs NULL bug in create_in_format_blob() Dan Carpenter
@ 2025-05-23 21:46 ` Dmitry Baryshkov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Baryshkov @ 2025-05-23 21:46 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Arun R Murthy, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter,
	Chaitanya Kumar Borah, Harry Wentland, Suraj Kandpal,
	Ville Syrjälä, Xaver Hugl, dri-devel, linux-kernel,
	kernel-janitors

On Fri, May 23, 2025 at 07:07:32PM +0300, Dan Carpenter wrote:
> The callers expect to receive error pointers on error but
> create_in_format_blob() returns NULL.  Change it to return error
> pointers.
> 
> Fixes: 0d6dcd741c26 ("drm/plane: modify create_in_formats to acommodate async")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
>  drivers/gpu/drm/drm_plane.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>

-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-05-23 21:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-23 16:07 [PATCH next] drm/plane: Fix error pointer vs NULL bug in create_in_format_blob() Dan Carpenter
2025-05-23 21:46 ` Dmitry Baryshkov

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.