DriverDev-Devel Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] drivers/staging/exfat: Ensure we unlock upon error in ffsReadFile
@ 2019-11-03 18:09 Davidlohr Bueso
  2019-11-03 18:18 ` Valdis Klētnieks
  0 siblings, 1 reply; 2+ messages in thread
From: Davidlohr Bueso @ 2019-11-03 18:09 UTC (permalink / raw)
  To: valdis.kletnieks, gregkh; +Cc: devel, Davidlohr Bueso, linux-kernel

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>
---
 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

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] drivers/staging/exfat: Ensure we unlock upon error in ffsReadFile
  2019-11-03 18:09 [PATCH] drivers/staging/exfat: Ensure we unlock upon error in ffsReadFile Davidlohr Bueso
@ 2019-11-03 18:18 ` Valdis Klētnieks
  0 siblings, 0 replies; 2+ messages in thread
From: Valdis Klētnieks @ 2019-11-03 18:18 UTC (permalink / raw)
  To: Davidlohr Bueso; +Cc: devel, gregkh, linux-kernel

[-- Attachment #1.1: Type: text/plain, Size: 365 bytes --]

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 <lkp@intel.com>
> Reported-by: Julia Lawall <julia.lawall@lip6.fr>
> Signed-off-by: Davidlohr Bueso <dave@stgolabs.net>

Yeah, I missed one, thanks for catching it.

Acked-By: Valdis Kletnieks <valdis.kletnieks@vt.edu>



[-- Attachment #1.2: Type: application/pgp-signature, Size: 832 bytes --]

[-- Attachment #2: Type: text/plain, Size: 169 bytes --]

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-03 18:09 [PATCH] drivers/staging/exfat: Ensure we unlock upon error in ffsReadFile Davidlohr Bueso
2019-11-03 18:18 ` Valdis Klētnieks

DriverDev-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/driverdev-devel/0 driverdev-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 driverdev-devel driverdev-devel/ https://lore.kernel.org/driverdev-devel \
		driverdev-devel@linuxdriverproject.org devel@driverdev.osuosl.org
	public-inbox-index driverdev-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.linuxdriverproject.driverdev-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git