diff options
author | Colin Ian King <colin.king@canonical.com> | 2021-06-03 14:28:12 +0200 |
---|---|---|
committer | Joel Stanley <joel@jms.id.au> | 2021-06-04 06:41:48 +0200 |
commit | 910810945707fe9877ca86a0dca4e585fd05e37b (patch) | |
tree | 0ecdbb134b09058135e50245b5388a70de9e81ff /drivers/fsi | |
parent | fsi: Add missing MODULE_DEVICE_TABLE (diff) | |
download | linux-910810945707fe9877ca86a0dca4e585fd05e37b.tar.xz linux-910810945707fe9877ca86a0dca4e585fd05e37b.zip |
fsi: core: Fix return of error values on failures
Currently the cfam_read and cfam_write functions return the provided
number of bytes given in the count parameter and not the error return
code in variable rc, hence all failures of read/writes are being
silently ignored. Fix this by returning the error code in rc.
Addresses-Coverity: ("Unused value")
Fixes: d1dcd6782576 ("fsi: Add cfam char devices")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Jeremy Kerr <jk@ozlabs.org>
Link: https://lore.kernel.org/r/20210603122812.83587-1-colin.king@canonical.com
Signed-off-by: Joel Stanley <joel@jms.id.au>
Diffstat (limited to 'drivers/fsi')
-rw-r--r-- | drivers/fsi/fsi-core.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c index 4e60e84cd17a..59ddc9fd5bca 100644 --- a/drivers/fsi/fsi-core.c +++ b/drivers/fsi/fsi-core.c @@ -724,7 +724,7 @@ static ssize_t cfam_read(struct file *filep, char __user *buf, size_t count, rc = count; fail: *offset = off; - return count; + return rc; } static ssize_t cfam_write(struct file *filep, const char __user *buf, @@ -761,7 +761,7 @@ static ssize_t cfam_write(struct file *filep, const char __user *buf, rc = count; fail: *offset = off; - return count; + return rc; } static loff_t cfam_llseek(struct file *file, loff_t offset, int whence) |