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

Author: Pierre-Eric Pelloux-Prayer <[email protected]>
Date:   Mon Nov 13 21:20:12 2023 +0100

radeonsi/sqtt: use calloc instead of malloc

This makes sure the record is fully initialized and
fixes RGP crashes or missing shaders.

Cc: mesa-stable
Reviewed-by: Marek Olšák <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26774>

---

 src/gallium/drivers/radeonsi/si_sqtt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/radeonsi/si_sqtt.c 
b/src/gallium/drivers/radeonsi/si_sqtt.c
index 08333728871..c01fb1b002e 100644
--- a/src/gallium/drivers/radeonsi/si_sqtt.c
+++ b/src/gallium/drivers/radeonsi/si_sqtt.c
@@ -1027,7 +1027,7 @@ si_sqtt_add_code_object(struct si_context* sctx,
    struct rgp_code_object *code_object = &sctx->sqtt->rgp_code_object;
    struct rgp_code_object_record *record;
 
-   record = malloc(sizeof(struct rgp_code_object_record));
+   record = calloc(1, sizeof(struct rgp_code_object_record));
    if (!record)
       return false;
 

Reply via email to