drivers/staging/exfat: Ensure we unlock upon error in ffsReadFile
PATCH 1/1 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(-)
drivers/staging/exfat/exfat_super.c +4 -2
@@ -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--; }
Signature · 1 line
2.16.4
Quoted 5 lines · Davidlohr Bueso
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]>