diff options
author | Colin Ian King <colin.king@canonical.com> | 2021-06-03 23:56:57 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-06-04 00:33:17 +0200 |
commit | ebbf5fcb94a7f3499747b282420a1c5f7e8d1c6f (patch) | |
tree | 91da4856ac82faedcf9bb25ed004ffd291d05a87 /drivers/net/netdevsim | |
parent | icmp: fix lib conflict with trinity (diff) | |
download | linux-ebbf5fcb94a7f3499747b282420a1c5f7e8d1c6f.tar.xz linux-ebbf5fcb94a7f3499747b282420a1c5f7e8d1c6f.zip |
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: d395381909a3 ("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>
Diffstat (limited to 'drivers/net/netdevsim')
-rw-r--r-- | drivers/net/netdevsim/bus.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/netdevsim/bus.c b/drivers/net/netdevsim/bus.c index b56003dfe3cc..ccec29970d5b 100644 --- a/drivers/net/netdevsim/bus.c +++ b/drivers/net/netdevsim/bus.c @@ -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) |