* [PATCH] staging: exfat: Fix two missing unlocks on error paths
@ 2019-09-04 9:59 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2019-09-04 9:59 UTC (permalink / raw)
To: Valdis Kletnieks; +Cc: devel, Greg Kroah-Hartman, kernel-janitors
These two error paths need to unlock before we can return.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/staging/exfat/exfat_super.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/exfat/exfat_super.c b/drivers/staging/exfat/exfat_super.c
index 5b5c2ca8c9aa..87e66e385e88 100644
--- a/drivers/staging/exfat/exfat_super.c
+++ b/drivers/staging/exfat/exfat_super.c
@@ -664,7 +670,7 @@ static int ffsLookupFile(struct inode *inode, char *path, struct file_id_t *fid)
dentry = p_fs->fs_func->find_dir_entry(sb, &dir, &uni_name, num_entries,
&dos_name, TYPE_ALL);
if (dentry < -1) {
- return FFS_NOTFOUND;
+ ret = FFS_NOTFOUND;
goto out;
}
@@ -1199,8 +1205,10 @@ static int ffsTruncateFile(struct inode *inode, u64 old_size, u64 new_size)
} else {
while (num_clusters > 0) {
last_clu = clu.dir;
- if (FAT_read(sb, clu.dir, &clu.dir) == -1)
- return FFS_MEDIAERR;
+ if (FAT_read(sb, clu.dir, &clu.dir) == -1) {
+ ret = FFS_MEDIAERR;
+ goto out;
+ }
num_clusters--;
}
}
--
2.20.1
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2019-09-04 10:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-04 9:59 [PATCH] staging: exfat: Fix two missing unlocks on error paths Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).