[PATCH 5.10 110/717] drm/udl: Fix missing error code in udl_handle_damage()
From: Greg Kroah-Hartman
Date: Mon Dec 28 2020 - 09:05:12 EST
From: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
[ Upstream commit a7319c8f50c5e93a12997e2d0821a2f7946fb734 ]
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@xxxxxxxxxx>
Signed-off-by: Thomas Zimmermann <tzimmermann@xxxxxxx>
Link: https://patchwork.freedesktop.org/patch/msgid/20201113101502.GD168908@mwanda
Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
---
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 fef43f4e3bac4..edcfd8c120c44 100644
--- a/drivers/gpu/drm/udl/udl_modeset.c
+++ b/drivers/gpu/drm/udl/udl_modeset.c
@@ -303,8 +303,10 @@ static int udl_handle_damage(struct drm_framebuffer *fb, int x, int y,
}
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.27.0