Patch "fsi: core: Fix return of error values on failures" has been added to the 5.13-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    fsi: core: Fix return of error values on failures

to the 5.13-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     fsi-core-fix-return-of-error-values-on-failures.patch
and it can be found in the queue-5.13 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 442bde6f604ad47238e10bc998a24ea6deebbe17
Author: Colin Ian King <colin.king@xxxxxxxxxxxxx>
Date:   Thu Jun 3 13:28:12 2021 +0100

    fsi: core: Fix return of error values on failures
    
    [ Upstream commit 910810945707fe9877ca86a0dca4e585fd05e37b ]
    
    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@xxxxxxxxxxxxx>
    Reviewed-by: Jeremy Kerr <jk@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20210603122812.83587-1-colin.king@xxxxxxxxxxxxx
    Signed-off-by: Joel Stanley <joel@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

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)



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux