Skip to content

Commit 33647d0

Browse files
arndbjoergroedel
authored andcommitted
iommu: ipmmu-vmsa: avoid Wformat-security warning
iommu_device_sysfs_add() requires a constant format string, otherwise a W=1 build produces a warning: drivers/iommu/ipmmu-vmsa.c:1093:62: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security] 1093 | ret = iommu_device_sysfs_add(&mmu->iommu, &pdev->dev, NULL, dev_name(&pdev->dev)); | ^~~~~~~~~~~~~~~~~~~~ drivers/iommu/ipmmu-vmsa.c:1093:62: note: treat the string as an argument to avoid this 1093 | ret = iommu_device_sysfs_add(&mmu->iommu, &pdev->dev, NULL, dev_name(&pdev->dev)); | ^ | "%s", This was an old bug but I saw it now because the code was changed as part of commit d9d3ced ("iommu/ipmmu-vmsa: Register in a sensible order"). Fixes: 7af9a5f ("iommu/ipmmu-vmsa: Use iommu_device_sysfs_add()/remove()") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Link: https://lore.kernel.org/r/20250423164006.2661372-1-arnd@kernel.org Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent 8ffd015 commit 33647d0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/iommu/ipmmu-vmsa.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1090,7 +1090,8 @@ static int ipmmu_probe(struct platform_device *pdev)
10901090
if (mmu->features->has_cache_leaf_nodes && ipmmu_is_root(mmu))
10911091
return 0;
10921092

1093-
ret = iommu_device_sysfs_add(&mmu->iommu, &pdev->dev, NULL, dev_name(&pdev->dev));
1093+
ret = iommu_device_sysfs_add(&mmu->iommu, &pdev->dev, NULL, "%s",
1094+
dev_name(&pdev->dev));
10941095
if (ret)
10951096
return ret;
10961097

0 commit comments

Comments
 (0)