2019-11-03 18:14:27

by Davidlohr Bueso

[permalink] [raw]
Subject: [PATCH] drivers/staging/exfat: Ensure we unlock upon error in ffsReadFile

The call was not releasing the mutex upon error.

Reported-by: kbuild test robot <[email protected]>
Reported-by: Julia Lawall <[email protected]>
Signed-off-by: Davidlohr Bueso <[email protected]>
---
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 e9e9868cae85..02dcfe06fc4f 100644
--- a/drivers/staging/exfat/exfat_super.c
+++ b/drivers/staging/exfat/exfat_super.c
@@ -742,8 +742,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--;
}
--
2.16.4


2019-11-03 18:19:22

by Valdis Klētnieks

[permalink] [raw]
Subject: Re: [PATCH] drivers/staging/exfat: Ensure we unlock upon error in ffsReadFile

On Sun, 03 Nov 2019 10:09:21 -0800, Davidlohr Bueso said:
> The call was not releasing the mutex upon error.
>
> Reported-by: kbuild test robot <[email protected]>
> Reported-by: Julia Lawall <[email protected]>
> Signed-off-by: Davidlohr Bueso <[email protected]>

Yeah, I missed one, thanks for catching it.

Acked-By: Valdis Kletnieks <[email protected]>



Attachments:
(No filename) (849.00 B)