mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH]   drivers/media/video: fix lock imbalances in hdpvr-core.c
@ 2009-08-12 15:08 iceberg
  0 siblings, 0 replies; only message in thread
From: iceberg @ 2009-08-12 15:08 UTC (permalink / raw)
  To: linux-kernel

In ./drivers/media/video/hdpvr/hdpvr-core.c in function 
device_authorization: 
        If after mutex_lock in usb_control_msg returns ret!=46 we go to 
label error. In this case before exit from function mutex must be unlocked.

Fix lock imbalances in function device_authorization.

Signed-off-by: Alexander Strakh <strakh@ispras.ru>

---
diff --git a/a/drivers/media/video/hdpvr/hdpvr-core.c 
b/b/drivers/media/video/hdpvr/hdpvr-core.c
index 188bd5a..1d03d1c 100644
--- a/a/drivers/media/video/hdpvr/hdpvr-core.c
+++ b/b/drivers/media/video/hdpvr/hdpvr-core.c
@@ -126,7 +126,7 @@ static int device_authorization(struct hdpvr_device *dev)
        char *print_buf = kzalloc(5*buf_size+1, GFP_KERNEL);
        if (!print_buf) {
                v4l2_err(&dev->v4l2_dev, "Out of memory\n");
-               goto error;
+               return retval;
        }
 #endif

@@ -188,10 +188,10 @@ static int device_authorization(struct hdpvr_device 
*dev)
                              10000);
        v4l2_dbg(MSG_INFO, hdpvr_debug, &dev->v4l2_dev,
                 "magic request returned %d\n", ret);
-       mutex_unlock(&dev->usbc_mutex);

        retval = ret != 8;
 error:
+       moutex_unlock(&dev->usbc_mutex);
        return retval;
 }




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

only message in thread, other threads:[~2009-08-12 11:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-12 15:08 [PATCH] drivers/media/video: fix lock imbalances in hdpvr-core.c iceberg

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

all inboxes | Powered by JetHome®