lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Date:	Wed, 12 Aug 2009 15:08:24 +0000
From:	iceberg <strakh@...ras.ru>
To:	linux-kernel@...r.kernel.org
Subject: [PATCH] 
  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.

Signed-off-by: Alexander Strakh <strakh@...ras.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;
 }



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ