staging: exfat: Fix two missing unlocks on error paths
Subsystems (2)
PATCH 1/1 staging: exfat: Fix two missing unlocks on error paths
These two error paths need to unlock before we can return.
Signed-off-by Dan Carpenter <[email protected]>
--- drivers/staging/exfat/exfat_super.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/staging/exfat/exfat_super.c +5 -3
@@ -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--; } }
Signature · 1 line
2.20.1