Skip to content

Commit c727ebe

Browse files
floatiouskwilczynski
authored andcommitted
misc: pci_endpoint_test: Fix potential truncation in pci_endpoint_test_probe()
Increase the size of the string buffer to avoid potential truncation in pci_endpoint_test_probe(). This fixes the following build warning when compiling with W=1: drivers/misc/pci_endpoint_test.c:29:49: note: directive argument in the range [0, 2147483647] 29 | #define DRV_MODULE_NAME "pci-endpoint-test" | ^~~~~~~~~~~~~~~~~~~ drivers/misc/pci_endpoint_test.c:998:38: note: in expansion of macro ‘DRV_MODULE_NAME’ 998 | snprintf(name, sizeof(name), DRV_MODULE_NAME ".%d", id); | ^~~~~~~~~~~~~~~ drivers/misc/pci_endpoint_test.c:998:9: note: ‘snprintf’ output between 20 and 29 bytes into a destination of size 24 998 | snprintf(name, sizeof(name), DRV_MODULE_NAME ".%d", id); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Niklas Cassel <[email protected]> Reviewed-by: Manivannan Sadhasivam <[email protected]> Reviewed-by: Frank Li <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Manivannan Sadhasivam <[email protected]> [kwilczynski: commit log] Signed-off-by: Krzysztof Wilczyński <[email protected]>
1 parent 2a93192 commit c727ebe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/misc/pci_endpoint_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -910,7 +910,7 @@ static int pci_endpoint_test_probe(struct pci_dev *pdev,
910910
{
911911
int ret;
912912
int id;
913-
char name[24];
913+
char name[29];
914914
enum pci_barno bar;
915915
void __iomem *base;
916916
struct device *dev = &pdev->dev;

0 commit comments

Comments
 (0)