* [PATCH] drm/udl: Fix missing error code in udl_handle_damage()
@ 2020-11-13 10:15 ` Dan Carpenter
0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2020-11-13 10:15 UTC (permalink / raw)
To: Dave Airlie, Thomas Zimmermann
Cc: David Airlie, kernel-janitors, dri-devel, Gerd Hoffmann,
Sean Paul, Emil Velikov
If udl_get_urb() fails then this should return a negative error code
but currently it returns success.
Fixes: 798ce3fe1c3a ("drm/udl: Begin/end access to imported buffers in damage-handler")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/gpu/drm/udl/udl_modeset.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/udl/udl_modeset.c b/drivers/gpu/drm/udl/udl_modeset.c
index 42eeba1dfdbf..9d34ec9d03f6 100644
--- a/drivers/gpu/drm/udl/udl_modeset.c
+++ b/drivers/gpu/drm/udl/udl_modeset.c
@@ -305,8 +305,10 @@ static int udl_handle_damage(struct drm_framebuffer *fb, int x, int y,
vaddr = map.vaddr; /* TODO: Use mapping abstraction properly */
urb = udl_get_urb(dev);
- if (!urb)
+ if (!urb) {
+ ret = -ENOMEM;
goto out_drm_gem_shmem_vunmap;
+ }
cmd = urb->transfer_buffer;
for (i = clip.y1; i < clip.y2; i++) {
--
2.28.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH] drm/udl: Fix missing error code in udl_handle_damage()
@ 2020-11-13 10:15 ` Dan Carpenter
0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2020-11-13 10:15 UTC (permalink / raw)
To: Dave Airlie, Thomas Zimmermann
Cc: David Airlie, kernel-janitors, dri-devel, Gerd Hoffmann,
Sean Paul, Emil Velikov
If udl_get_urb() fails then this should return a negative error code
but currently it returns success.
Fixes: 798ce3fe1c3a ("drm/udl: Begin/end access to imported buffers in damage-handler")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/gpu/drm/udl/udl_modeset.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/udl/udl_modeset.c b/drivers/gpu/drm/udl/udl_modeset.c
index 42eeba1dfdbf..9d34ec9d03f6 100644
--- a/drivers/gpu/drm/udl/udl_modeset.c
+++ b/drivers/gpu/drm/udl/udl_modeset.c
@@ -305,8 +305,10 @@ static int udl_handle_damage(struct drm_framebuffer *fb, int x, int y,
vaddr = map.vaddr; /* TODO: Use mapping abstraction properly */
urb = udl_get_urb(dev);
- if (!urb)
+ if (!urb) {
+ ret = -ENOMEM;
goto out_drm_gem_shmem_vunmap;
+ }
cmd = urb->transfer_buffer;
for (i = clip.y1; i < clip.y2; i++) {
--
2.28.0
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] drm/udl: Fix missing error code in udl_handle_damage()
2020-11-13 10:15 ` Dan Carpenter
@ 2020-11-13 10:43 ` Thomas Zimmermann
-1 siblings, 0 replies; 4+ messages in thread
From: Thomas Zimmermann @ 2020-11-13 10:43 UTC (permalink / raw)
To: Dan Carpenter, Dave Airlie
Cc: David Airlie, kernel-janitors, dri-devel, Gerd Hoffmann,
Sean Paul, Emil Velikov
Hi
Am 13.11.20 um 11:15 schrieb Dan Carpenter:
> If udl_get_urb() fails then this should return a negative error code
> but currently it returns success.
>
> Fixes: 798ce3fe1c3a ("drm/udl: Begin/end access to imported buffers in damage-handler")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Thanks for the patch. As it has a Fixes tag, it's probably worth taking
for silencing compiler warnings alone. I'll add it to the tree.
In practice, it doesn't really matter. udl_handle_damage() is running
during the DRM commit phase and it's too late to handle errors. We could
as well convert the the function to void.
Best regards
Thomas
> ---
> drivers/gpu/drm/udl/udl_modeset.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/udl/udl_modeset.c b/drivers/gpu/drm/udl/udl_modeset.c
> index 42eeba1dfdbf..9d34ec9d03f6 100644
> --- a/drivers/gpu/drm/udl/udl_modeset.c
> +++ b/drivers/gpu/drm/udl/udl_modeset.c
> @@ -305,8 +305,10 @@ static int udl_handle_damage(struct drm_framebuffer *fb, int x, int y,
> vaddr = map.vaddr; /* TODO: Use mapping abstraction properly */
>
> urb = udl_get_urb(dev);
> - if (!urb)
> + if (!urb) {
> + ret = -ENOMEM;
> goto out_drm_gem_shmem_vunmap;
> + }
> cmd = urb->transfer_buffer;
>
> for (i = clip.y1; i < clip.y2; i++) {
>
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] drm/udl: Fix missing error code in udl_handle_damage()
@ 2020-11-13 10:43 ` Thomas Zimmermann
0 siblings, 0 replies; 4+ messages in thread
From: Thomas Zimmermann @ 2020-11-13 10:43 UTC (permalink / raw)
To: Dan Carpenter, Dave Airlie
Cc: David Airlie, kernel-janitors, dri-devel, Gerd Hoffmann,
Sean Paul, Emil Velikov
Hi
Am 13.11.20 um 11:15 schrieb Dan Carpenter:
> If udl_get_urb() fails then this should return a negative error code
> but currently it returns success.
>
> Fixes: 798ce3fe1c3a ("drm/udl: Begin/end access to imported buffers in damage-handler")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Thanks for the patch. As it has a Fixes tag, it's probably worth taking
for silencing compiler warnings alone. I'll add it to the tree.
In practice, it doesn't really matter. udl_handle_damage() is running
during the DRM commit phase and it's too late to handle errors. We could
as well convert the the function to void.
Best regards
Thomas
> ---
> drivers/gpu/drm/udl/udl_modeset.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/udl/udl_modeset.c b/drivers/gpu/drm/udl/udl_modeset.c
> index 42eeba1dfdbf..9d34ec9d03f6 100644
> --- a/drivers/gpu/drm/udl/udl_modeset.c
> +++ b/drivers/gpu/drm/udl/udl_modeset.c
> @@ -305,8 +305,10 @@ static int udl_handle_damage(struct drm_framebuffer *fb, int x, int y,
> vaddr = map.vaddr; /* TODO: Use mapping abstraction properly */
>
> urb = udl_get_urb(dev);
> - if (!urb)
> + if (!urb) {
> + ret = -ENOMEM;
> goto out_drm_gem_shmem_vunmap;
> + }
> cmd = urb->transfer_buffer;
>
> for (i = clip.y1; i < clip.y2; i++) {
>
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-11-13 10:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-13 10:15 [PATCH] drm/udl: Fix missing error code in udl_handle_damage() Dan Carpenter
2020-11-13 10:15 ` Dan Carpenter
2020-11-13 10:43 ` Thomas Zimmermann
2020-11-13 10:43 ` Thomas Zimmermann
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.