Re: [PATCH rdma-next v1] RDMA/IPoIB: Fix format truncation compilation errors

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

 



On Thu, 09 May 2024 10:39:33 +0300, Leon Romanovsky wrote:
> Truncate the device name to store IPoIB VLAN name.
> 
> [leonro@5b4e8fba4ddd kernel]$ make -s -j 20 allmodconfig
> [leonro@5b4e8fba4ddd kernel]$ make -s -j 20 W=1 drivers/infiniband/ulp/ipoib/
> drivers/infiniband/ulp/ipoib/ipoib_vlan.c: In function ‘ipoib_vlan_add’:
> drivers/infiniband/ulp/ipoib/ipoib_vlan.c:187:52: error: ‘%04x’
> directive output may be truncated writing 4 bytes into a region of size
> between 0 and 15 [-Werror=format-truncation=]
>   187 |         snprintf(intf_name, sizeof(intf_name), "%s.%04x",
>       |                                                    ^~~~
> drivers/infiniband/ulp/ipoib/ipoib_vlan.c:187:48: note: directive
> argument in the range [0, 65535]
>   187 |         snprintf(intf_name, sizeof(intf_name), "%s.%04x",
>       |                                                ^~~~~~~~~
> drivers/infiniband/ulp/ipoib/ipoib_vlan.c:187:9: note: ‘snprintf’ output
> between 6 and 21 bytes into a destination of size 16
>   187 |         snprintf(intf_name, sizeof(intf_name), "%s.%04x",
>       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>   188 |                  ppriv->dev->name, pkey);
>       |                  ~~~~~~~~~~~~~~~~~~~~~~~
> cc1: all warnings being treated as errors
> make[6]: *** [scripts/Makefile.build:244: drivers/infiniband/ulp/ipoib/ipoib_vlan.o] Error 1
> make[6]: *** Waiting for unfinished jobs....
> 
> [...]

Applied, thanks!

[1/1] RDMA/IPoIB: Fix format truncation compilation errors
      https://git.kernel.org/rdma/rdma/c/49ca2b2ef3d003

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