From 6647e4e84501e7f935f108729da9a6fd60924d8b Mon Sep 17 00:00:00 2001 From: Davidlohr Bueso Date: Sun, 3 Nov 2019 10:09:21 -0800 Subject: [PATCH] staging: exfat: Ensure we unlock upon error in ffsReadFile The call was not releasing the mutex upon error. Reported-by: kbuild test robot Reported-by: Julia Lawall Signed-off-by: Davidlohr Bueso Acked-By: Valdis Kletnieks Link: https://lore.kernel.org/r/20191103180921.2844-1-dave@stgolabs.net Signed-off-by: Greg Kroah-Hartman --- drivers/staging/exfat/exfat_super.c | 6 ++++-- 1 file 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--; }