From d93e7ef99f470ef1ea2391b90b21907c3665ab70 Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Mon, 13 Nov 2023 21:20:12 +0100 Subject: [PATCH] radeonsi/sqtt: use calloc instead of malloc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This makes sure the record is fully initialized and fixes RGP crashes or missing shaders. Cc: mesa-stable Reviewed-by: Marek Olšák Part-of: (cherry picked from commit af8e6c93473da991abbf588ce24ef409b08e84ce) --- .pick_status.json | 2 +- src/gallium/drivers/radeonsi/si_sqtt.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 1345c776293..759b86b4638 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -174,7 +174,7 @@ "description": "radeonsi/sqtt: use calloc instead of malloc", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/gallium/drivers/radeonsi/si_sqtt.c b/src/gallium/drivers/radeonsi/si_sqtt.c index eeaa83f05c4..f80d01a401f 100644 --- a/src/gallium/drivers/radeonsi/si_sqtt.c +++ b/src/gallium/drivers/radeonsi/si_sqtt.c @@ -1031,7 +1031,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;