Commit ebbf5fcb authored by Colin Ian King's avatar Colin Ian King Committed by David S. Miller

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: d3953819 ("netdevsim: Add max_vfs to bus_dev")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e32ea44c
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment