staging: exfat: Ensure we unlock upon error in ffsReadFile

The call was not releasing the mutex upon error.

Reported-by: kbuild test robot <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Davidlohr Bueso <dave@stgolabs.net>
Acked-By: Valdis Kletnieks <valdis.kletnieks@vt.edu>
Link: https://lore.kernel.org/r/20191103180921.2844-1-dave@stgolabs.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Davidlohr Bueso 2019-11-03 10:09:21 -08:00 committed by Greg Kroah-Hartman
parent 19c1e145a4
commit 6647e4e845
1 changed files with 4 additions and 2 deletions

View File

@ -743,8 +743,10 @@ static int ffsReadFile(struct inode *inode, struct file_id_t *fid, void *buffer,
while (clu_offset > 0) {
/* clu = FAT_read(sb, clu); */
if (FAT_read(sb, clu, &clu) == -1)
return FFS_MEDIAERR;
if (FAT_read(sb, clu, &clu) == -1) {
ret = FFS_MEDIAERR;
goto out;
}
clu_offset--;
}