linux/drivers/infiniband/hw
Arnd Bergmann d0dbf77130 IB/mlx4: fix sprintf format warning
gcc-7 points out that a negative port_num value would overflow the
string buffer:

  drivers/infiniband/hw/mlx4/sysfs.c: In function 'mlx4_ib_device_register_sysfs':
  drivers/infiniband/hw/mlx4/sysfs.c:251:16: error: 'sprintf' may write a terminating nul past the end of the destination [-Werror=format-overflow=]
  drivers/infiniband/hw/mlx4/sysfs.c:251:2: note: 'sprintf' output between 2 and 11 bytes into a destination of size 10
  drivers/infiniband/hw/mlx4/sysfs.c:303:17: error: 'sprintf' may write a terminating nul past the end of the destination [-Werror=format-overflow=]
  drivers/infiniband/hw/mlx4/sysfs.c:303:3: note: 'sprintf' output between 2 and 11 bytes into a destination of size 10

While we should be able to assume that port_num is positive here, making
the buffer one byte longer has no downsides and avoids the warning.

Fixes: c1e7e46612 ("IB/mlx4: Add iov directory in sysfs under the ib device")
Link: http://lkml.kernel.org/r/20170714120720.906842-23-arnd@arndb.de
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-09-13 18:53:15 -07:00
..
bnxt_re Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2017-09-06 14:45:08 -07:00
cxgb3 RDMA: Simplify get firmware interface 2017-08-10 13:28:10 +03:00
cxgb4 Merge branch 'k.o/for-4.13-rc' into k.o/for-next 2017-08-18 14:12:04 -04:00
hfi1 lib/interval_tree: fast overlap detection 2017-09-08 18:26:49 -07:00
hns Merge branch 'k.o/for-4.13-rc' into k.o/for-next 2017-08-18 14:12:04 -04:00
i40iw i40iw: make some structures const 2017-08-28 19:12:26 -04:00
mlx4 IB/mlx4: fix sprintf format warning 2017-09-13 18:53:15 -07:00
mlx5 IB/mlx5: Support IB_SRQT_TM 2017-08-29 08:30:20 -04:00
mthca RDMA/mthca: Make explicit conversion to 64bit value 2017-08-24 16:27:10 -04:00
nes RDMA/nes: Remove zeroed parameter from port query callback 2017-08-24 16:44:48 -04:00
ocrdma RDMA: Simplify get firmware interface 2017-08-10 13:28:10 +03:00
qedr RDMA/qedr: fix spelling mistake: "invlaid" -> "invalid" 2017-08-24 17:34:57 -04:00
qib IB/qib: Convert qp_stats debugfs interface to use new iterator API 2017-08-28 19:12:30 -04:00
usnic lib/interval_tree: fast overlap detection 2017-09-08 18:26:49 -07:00
vmw_pvrdma RDMA/vmw_pvrdma: Fix a signedness 2017-08-31 08:35:08 -04:00
Makefile RDMA/bnxt_re: Add bnxt_re driver build support 2017-02-14 09:51:28 -05:00