aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/exfat/exfat_super.c
diff options
context:
space:
mode:
authorDavidlohr Bueso <dave@stgolabs.net>2019-11-03 10:09:21 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-11-03 19:40:09 +0100
commit6647e4e84501e7f935f108729da9a6fd60924d8b (patch)
tree6181ad7a1d6129951c5a57c5f5f24f4ad7195d71 /drivers/staging/exfat/exfat_super.c
parentstaging: rtl8723bs: Remove unnecessary parentheses (diff)
downloadlinux-dev-6647e4e84501e7f935f108729da9a6fd60924d8b.tar.xz
linux-dev-6647e4e84501e7f935f108729da9a6fd60924d8b.zip
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>
Diffstat (limited to '')
-rw-r--r--drivers/staging/exfat/exfat_super.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/staging/exfat/exfat_super.c b/drivers/staging/exfat/exfat_super.c
index 5f972588669c..1ae5a7750348 100644
--- a/drivers/staging/exfat/exfat_super.c
+++ b/drivers/staging/exfat/exfat_super.c
@@ -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--;
}