diff options
author | Colin Ian King <colin.king@canonical.com> | 2019-08-22 03:03:50 +0200 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2019-09-04 17:30:16 +0200 |
commit | 6811d26df50d96635dd339cf8cdf43a6abc0c4b6 (patch) | |
tree | 14cfdbf2af0d860a7ef1457b331e8b67a1bf2081 /drivers/bus/moxtet.c | |
parent | caebdd3c114e522b5c9bda2098990e09abfba5b0 (diff) | |
download | linux-6811d26df50d96635dd339cf8cdf43a6abc0c4b6.tar.bz2 |
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: 5bc7f990cd98 ("bus: Add support for Moxtet bus")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Marek BehĂșn <marek.behun@nic.cz>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers/bus/moxtet.c')
-rw-r--r-- | drivers/bus/moxtet.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/bus/moxtet.c b/drivers/bus/moxtet.c index baccf7609357..36cf13eee6b8 100644 --- a/drivers/bus/moxtet.c +++ b/drivers/bus/moxtet.c @@ -514,7 +514,7 @@ static ssize_t output_write(struct file *file, const char __user *buf, struct moxtet *moxtet = file->private_data; u8 bin[TURRIS_MOX_MAX_MODULES]; u8 hex[sizeof(bin) * 2 + 1]; - size_t res; + ssize_t res; loff_t dummy = 0; int err, i; |