]> git.baikalelectronics.ru Git - kernel.git/commit
net: hns3: refine the input parameter 'size' for snprintf()
authorGuojia Liao <liaoguojia@huawei.com>
Tue, 21 Jan 2020 08:42:09 +0000 (16:42 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 21 Jan 2020 10:46:21 +0000 (11:46 +0100)
commite9516cc0f4cb0d017bff11a56036ec26e875a4c8
tree630ce0b1326ffe436fd9deb54efe1fc0b026243c
parent8a6ad9f5389b77e999415b3fbce1f2e8933be6ac
net: hns3: refine the input parameter 'size' for snprintf()

The function snprintf() writes at most size bytes (including the
terminating null byte ('\0') to str. Now, We can guarantee that the
parameter of size is lager than the length of str to be formatting
including its terminating null byte. So it's unnecessary to minus 1
for the input parameter 'size'.

Signed-off-by: Guojia Liao <liaoguojia@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c