1
0
Fork 0

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 <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20190904095908.GA7007@mwanda
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
alistair/sunxi64-5.4-dsi
Dan Carpenter 2019-09-04 12:59:08 +03:00 committed by Greg Kroah-Hartman
parent 512f9922ee
commit 7f95bb6aa3
1 changed files with 4 additions and 2 deletions

View File

@ -1208,8 +1208,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--;
}
}