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: c1e7e466120b ("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
..
2017-09-11 13:10:57 -07:00
2017-09-12 13:30:06 -07:00
2017-09-12 20:03:53 -07:00
2017-09-10 20:40:00 -07:00
2017-09-12 13:30:06 -07:00
2017-09-05 12:45:03 -07:00
2017-09-07 14:03:05 -07:00
2017-09-03 10:17:53 -07:00
2017-09-07 14:03:05 -07:00
2017-09-07 13:51:13 -07:00
2017-09-07 12:53:14 -07:00
2017-09-07 13:51:13 -07:00
2017-09-07 13:51:13 -07:00
2017-09-09 15:03:24 -07:00
2017-09-07 14:33:13 -07:00
2017-09-05 11:08:17 -07:00
2017-09-10 20:40:00 -07:00
2017-09-07 13:51:13 -07:00
2017-09-08 15:47:43 -07:00
2017-09-09 14:48:21 -07:00
2017-08-29 13:46:35 +02:00
2017-09-12 13:30:06 -07:00
2017-09-11 13:10:57 -07:00
2017-09-12 13:30:06 -07:00
2017-09-05 11:08:17 -07:00
2017-09-08 15:47:43 -07:00
2017-09-08 15:47:43 -07:00
2017-09-07 13:51:13 -07:00
2017-09-08 16:04:50 -07:00
2017-09-11 13:04:32 -07:00
2017-09-07 13:51:13 -07:00
2017-09-09 14:34:38 -07:00
2017-09-10 20:40:00 -07:00
2017-09-13 10:56:00 -07:00
2017-09-13 10:47:14 -07:00
2017-09-10 20:40:00 -07:00
2017-09-05 12:45:03 -07:00
2017-09-09 14:48:21 -07:00
2017-09-05 12:45:03 -07:00
2017-09-12 13:30:06 -07:00
2017-08-30 14:03:42 -06:00
2017-09-07 13:55:16 -07:00
2017-09-07 21:11:05 -07:00
2017-09-07 10:24:21 -07:00
2017-08-24 09:57:28 +02:00