Skip to contentSkip to conversation

drivers/media/video: fix lock imbalances in hdpvr-core.c

PATCH New iceberg 1 participant 1 message Aug 12, 2009

lore
Share & tools
lore

iceberg

author
#0 lore raw

PATCH 1/1 drivers/media/video: fix lock imbalances in hdpvr-core.c

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.

---

(quoted diff) +0 -0

b/b/drivers/media/video/hdpvr/hdpvr-core.c
index 188bd5a..1d03d1c 100644

b/drivers/media/video/hdpvr/hdpvr-core.c renamed from a/drivers/media/video/hdpvr/hdpvr-core.c +1 -1
@@ -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;

}