Re: [PATCH rdma-next] RDMA/mlx4: Fix truncated output warning in mad.c

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

 



On Sun, 16 Jun 2024 19:16:33 +0300, Leon Romanovsky wrote:
> Increase size of the name array to avoid truncated output warning.
> 
> drivers/infiniband/hw/mlx4/mad.c: In function ‘mlx4_ib_alloc_demux_ctx’:
> drivers/infiniband/hw/mlx4/mad.c:2197:47: error: ‘%d’ directive output
> may be truncated writing between 1 and 11 bytes into a region of size 4
> [-Werror=format-truncation=]
>  2197 |         snprintf(name, sizeof(name), "mlx4_ibt%d", port);
>       |                                               ^~
> drivers/infiniband/hw/mlx4/mad.c:2197:38: note: directive argument in
> the range [-2147483645, 2147483647]
>  2197 |         snprintf(name, sizeof(name), "mlx4_ibt%d", port);
>       |                                      ^~~~~~~~~~~~
> drivers/infiniband/hw/mlx4/mad.c:2197:9: note: ‘snprintf’ output between
> 10 and 20 bytes into a destination of size 12
>  2197 |         snprintf(name, sizeof(name), "mlx4_ibt%d", port);
>       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/infiniband/hw/mlx4/mad.c:2205:48: error: ‘%d’ directive output
> may be truncated writing between 1 and 11 bytes into a region of size 3
> [-Werror=format-truncation=]
>  2205 |         snprintf(name, sizeof(name), "mlx4_ibwi%d", port);
>       |                                                ^~
> drivers/infiniband/hw/mlx4/mad.c:2205:38: note: directive argument in
> the range [-2147483645, 2147483647]
>  2205 |         snprintf(name, sizeof(name), "mlx4_ibwi%d", port);
>       |                                      ^~~~~~~~~~~~~
> drivers/infiniband/hw/mlx4/mad.c:2205:9: note: ‘snprintf’ output between
> 11 and 21 bytes into a destination of size 12
>  2205 |         snprintf(name, sizeof(name), "mlx4_ibwi%d", port);
>       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/infiniband/hw/mlx4/mad.c:2213:48: error: ‘%d’ directive output
> may be truncated writing between 1 and 11 bytes into a region of size 3
> [-Werror=format-truncation=]
>  2213 |         snprintf(name, sizeof(name), "mlx4_ibud%d", port);
>       |                                                ^~
> drivers/infiniband/hw/mlx4/mad.c:2213:38: note: directive argument in
> the range [-2147483645, 2147483647]
>  2213 |         snprintf(name, sizeof(name), "mlx4_ibud%d", port);
>       |                                      ^~~~~~~~~~~~~
> drivers/infiniband/hw/mlx4/mad.c:2213:9: note: ‘snprintf’ output between
> 11 and 21 bytes into a destination of size 12
>  2213 |         snprintf(name, sizeof(name), "mlx4_ibud%d", port);
>       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> cc1: all warnings being treated as errors
> make[6]: *** [scripts/Makefile.build:244: drivers/infiniband/hw/mlx4/mad.o] Error 1
> 
> [...]

Applied, thanks!

[1/1] RDMA/mlx4: Fix truncated output warning in mad.c
      https://git.kernel.org/rdma/rdma/c/01c6d9f59148b6

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