]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
x86/events/amd/iommu: Increase IOMMU_NAME_SIZE
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 10 Feb 2025 19:34:12 +0000 (21:34 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Fri, 14 Feb 2025 09:32:02 +0000 (10:32 +0100)
The init_one_iommu() takes an unsigned int argument that can't be checked for
the boundaries at compile time and GCC complains about that when build with
`make W=1`:

arch/x86/events/amd/iommu.c:441:53: note: directive argument in the range [0, 4294967294]
arch/x86/events/amd/iommu.c:441:9: note: ‘snprintf’ output between 12 and 21 bytes into a destination of size 16

Increase the size to cover all possible cases.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20250210193412.483233-1-andriy.shevchenko@linux.intel.com
arch/x86/events/amd/iommu.c

index b15f7b950d2e01ba07889e1bf08b327ad00b9f6b..f8228d8243f7d8101000c63cb41109aef5303e09 100644 (file)
@@ -30,7 +30,7 @@
 #define GET_DOMID_MASK(x)  (((x)->conf1 >> 16) & 0xFFFFULL)
 #define GET_PASID_MASK(x)  (((x)->conf1 >> 32) & 0xFFFFFULL)
 
-#define IOMMU_NAME_SIZE 16
+#define IOMMU_NAME_SIZE 24
 
 struct perf_amd_iommu {
        struct list_head list;