Skip to content
Unverified Commit c727ebe9 authored by Niklas Cassel's avatar Niklas Cassel Committed by Krzysztof Wilczyński
Browse files

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: default avatarNiklas Cassel <cassel@kernel.org>
Reviewed-by: default avatarManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: default avatarFrank Li <Frank.Li@nxp.com>
Link: https://lore.kernel.org/r/20250123103127.3581432-2-cassel@kernel.org


Signed-off-by: default avatarManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
[kwilczynski: commit log]
Signed-off-by: default avatarKrzysztof Wilczyński <kwilczynski@kernel.org>
parent 2a93192d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment