public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] au0828: fix unbalanced lock/unlock in au0828_usb_probe
@ 2017-08-12 17:30 Gustavo A. R. Silva
  0 siblings, 0 replies; only message in thread
From: Gustavo A. R. Silva @ 2017-08-12 17:30 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: Julia Lawall, linux-media, linux-kernel, Gustavo A. R. Silva

Call mutex_unlock and free dev on failure.

Reported-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 drivers/media/usb/au0828/au0828-core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/media/usb/au0828/au0828-core.c b/drivers/media/usb/au0828/au0828-core.c
index 739df61..cd363a2 100644
--- a/drivers/media/usb/au0828/au0828-core.c
+++ b/drivers/media/usb/au0828/au0828-core.c
@@ -628,6 +628,8 @@ static int au0828_usb_probe(struct usb_interface *interface,
 	if (retval) {
 		pr_err("%s() au0282_dev_register failed to register on V4L2\n",
 			__func__);
+		mutex_unlock(&dev->lock);
+		kfree(dev);
 		goto done;
 	}
 
-- 
2.5.0

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-08-12 17:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-12 17:30 [PATCH] au0828: fix unbalanced lock/unlock in au0828_usb_probe Gustavo A. R. Silva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox