[PATCH 28/32] fs: fat: propagate f_lseek failure

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

 



We store an error code to ret, but don't act on it. Fix this.

Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx>
---
 fs/fat/fat.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index 84bfe69089e5..7d888817c145 100644
--- a/fs/fat/fat.c
+++ b/fs/fat/fat.c
@@ -196,6 +196,11 @@ static int fat_open(struct device_d *dev, FILE *file, const char *filename)
 
 	if (file->flags & O_APPEND) {
 		ret = f_lseek(f_file, f_file->fsize);
+		if (ret) {
+			f_close(f_file);
+			free(f_file);
+			return -EINVAL;
+		}
 	}
 
 	file->priv = f_file;
-- 
2.30.2





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux