Module: Mesa
Branch: main
Commit: 8568a46c1ca64092dd2f3f8f140ea1f261db2b1c
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8568a46c1ca64092dd2f3f8f140ea1f261db2b1c

Author: Boris Brezillon <[email protected]>
Date:   Fri Jun 23 09:08:31 2023 +0200

renderonly: Fix potential NULL deref in the error path

scanout can be NULL.

Fixes: ad4d7ca83324 ("kmsro: Fix renderonly_scanout BO aliasing")
Cc: mesa-stable
Signed-off-by: Boris Brezillon <[email protected]>
Reviewed-by: Alyssa Rosenzweig <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23746>

---

 src/gallium/auxiliary/renderonly/renderonly.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/renderonly/renderonly.c 
b/src/gallium/auxiliary/renderonly/renderonly.c
index d3efdfae251..386665f25cb 100644
--- a/src/gallium/auxiliary/renderonly/renderonly.c
+++ b/src/gallium/auxiliary/renderonly/renderonly.c
@@ -114,7 +114,7 @@ renderonly_create_kms_dumb_buffer_for_resource(struct 
pipe_resource *rsc,
    return scanout;
 
 free_dumb:
-   destroy_dumb.handle = scanout->handle;
+   destroy_dumb.handle = create_dumb.handle;
    drmIoctl(ro->kms_fd, DRM_IOCTL_MODE_DESTROY_DUMB, &destroy_dumb);
 
    return NULL;

Reply via email to