Commit 6811d26d authored by Colin Ian King's avatar Colin Ian King Committed by Arnd Bergmann

bus: moxtet: fix unsigned comparison to less than zero

Currently the size_t variable res is being checked for
an error failure however the unsigned variable is never
less than zero so this test is always false. Fix this by
making variable res ssize_t

Link: https://lore.kernel.org/r/20190822010351.15660-2-marek.behun@nic.cz
Addresses-Coverity: ("Unsigned compared against 0")
Fixes: 5bc7f990 ("bus: Add support for Moxtet bus")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Signed-off-by: default avatarMarek Behún <marek.behun@nic.cz>
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parent caebdd3c
...@@ -514,7 +514,7 @@ static ssize_t output_write(struct file *file, const char __user *buf, ...@@ -514,7 +514,7 @@ static ssize_t output_write(struct file *file, const char __user *buf,
struct moxtet *moxtet = file->private_data; struct moxtet *moxtet = file->private_data;
u8 bin[TURRIS_MOX_MAX_MODULES]; u8 bin[TURRIS_MOX_MAX_MODULES];
u8 hex[sizeof(bin) * 2 + 1]; u8 hex[sizeof(bin) * 2 + 1];
size_t res; ssize_t res;
loff_t dummy = 0; loff_t dummy = 0;
int err, i; int err, i;
......
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