mirror of
https://github.com/torvalds/linux.git
synced 2024-12-21 02:21:36 +00:00
netdevsim: Fix unsigned being compared to less than zero
The comparison of len < 0 is always false because len is a size_t. Fix
this by making len a ssize_t instead.
Addresses-Coverity: ("Unsigned compared against 0")
Fixes: d395381909
("netdevsim: Add max_vfs to bus_dev")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
e32ea44c7a
commit
ebbf5fcb94
@ -111,7 +111,7 @@ ssize_t nsim_bus_dev_max_vfs_read(struct file *file,
|
||||
{
|
||||
struct nsim_bus_dev *nsim_bus_dev = file->private_data;
|
||||
char buf[11];
|
||||
size_t len;
|
||||
ssize_t len;
|
||||
|
||||
len = snprintf(buf, sizeof(buf), "%u\n", nsim_bus_dev->max_vfs);
|
||||
if (len < 0)
|
||||
|
Loading…
Reference in New Issue
Block a user