[PATCH 1/2] drm/amdgpu/pptable: Fix __counted_by attribute

Mario Limonciello mario.limonciello at amd.com
Fri Jun 14 17:05:50 UTC 2024


The attribute is not helpful if commented out.

Cc: Tasos Sahanidis <tasos at tasossah.com>
Fixes: c6c4dd540125 ("drm/amdgpu/pptable: Fix UBSAN array-index-out-of-bounds")
Signed-off-by: Mario Limonciello <mario.limonciello at amd.com>
---
 drivers/gpu/drm/amd/include/pptable.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/include/pptable.h b/drivers/gpu/drm/amd/include/pptable.h
index f83ace2d7ec3..984770d0eb4c 100644
--- a/drivers/gpu/drm/amd/include/pptable.h
+++ b/drivers/gpu/drm/amd/include/pptable.h
@@ -480,7 +480,7 @@ typedef struct _StateArray{
 	//how many states we have
 	UCHAR ucNumEntries;
 
-	ATOM_PPLIB_STATE_V2 states[] /* __counted_by(ucNumEntries) */;
+	ATOM_PPLIB_STATE_V2 states[] __counted_by(ucNumEntries);
 }StateArray;
 
 
-- 
2.43.0



More information about the amd-gfx mailing list