Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Colin Ian King and committed by
Joel Stanley
91081094 19a52178

+2 -2
+2 -2
drivers/fsi/fsi-core.c
··· 724 724 rc = count; 725 725 fail: 726 726 *offset = off; 727 - return count; 727 + return rc; 728 728 } 729 729 730 730 static ssize_t cfam_write(struct file *filep, const char __user *buf, ··· 761 761 rc = count; 762 762 fail: 763 763 *offset = off; 764 - return count; 764 + return rc; 765 765 } 766 766 767 767 static loff_t cfam_llseek(struct file *file, loff_t offset, int whence)