Re: [PATCH rdma-next] RDMA/hfi1: Workaround truncation compilation error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 24 Oct 2023 18:07:31 +0300, Leon Romanovsky wrote:
> Increase name array to be large enough to overcome the following
> compilation error.
> 
> drivers/infiniband/hw/hfi1/efivar.c: In function ‘read_hfi1_efi_var’:
> drivers/infiniband/hw/hfi1/efivar.c:124:44: error: ‘snprintf’ output may be truncated before the last format character [-Werror=format-truncation=]
>   124 |         snprintf(name, sizeof(name), "%s-%s", prefix_name, kind);
>       |                                            ^
> drivers/infiniband/hw/hfi1/efivar.c:124:9: note: ‘snprintf’ output 2 or more bytes (assuming 65) into a destination of size 64
>   124 |         snprintf(name, sizeof(name), "%s-%s", prefix_name, kind);
>       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/infiniband/hw/hfi1/efivar.c:133:52: error: ‘snprintf’ output may be truncated before the last format character [-Werror=format-truncation=]
>   133 |                 snprintf(name, sizeof(name), "%s-%s", prefix_name, kind);
>       |                                                    ^
> drivers/infiniband/hw/hfi1/efivar.c:133:17: note: ‘snprintf’ output 2 or more bytes (assuming 65) into a destination of size 64
>   133 |                 snprintf(name, sizeof(name), "%s-%s", prefix_name, kind);
>       |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> cc1: all warnings being treated as errors
> make[6]: *** [scripts/Makefile.build:243: drivers/infiniband/hw/hfi1/efivar.o] Error 1
> 
> [...]

Applied, thanks!

[1/1] RDMA/hfi1: Workaround truncation compilation error
      https://git.kernel.org/rdma/rdma/c/d4b2d165714c0c

Best regards,
-- 
Leon Romanovsky <leon@xxxxxxxxxx>



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux