lkml.org 
[lkml]   [2012]   [Jun]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 09/13] remove unneeded lock in skel_open
Date
From: Stefani Seibold <stefani@seibold.net>

The io_mutex must not acquired since a disconnect waits in usb_deregister_dev()
due the already locked minor_rwsem in the usb_open() function

Signed-off-by: Stefani Seibold <stefani@seibold.net>
---
drivers/usb/usb-skeleton.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/usb-skeleton.c b/drivers/usb/usb-skeleton.c
index 61f4ac8..6482acb 100644
--- a/drivers/usb/usb-skeleton.c
+++ b/drivers/usb/usb-skeleton.c
@@ -95,11 +95,11 @@ static int skel_open(struct inode *inode, struct file *file)
/* increment our usage count for the device */
kref_get(&dev->kref);

- /* lock the device to allow correctly handling errors
- * in resumption */
- mutex_lock(&dev->io_mutex);
+ /*
+ * must be not locked since disconnect waits in usb_deregister_dev()
+ * due the already locked minor_rwsem in the usb_open() function
+ */
retval = usb_autopm_get_interface(interface);
- mutex_unlock(&dev->io_mutex);

/* save our object in the file's private structure */
if (!retval)
--
1.7.8.6


\
 
 \ /
  Last update: 2012-06-07 12:42    [W:0.192 / U:0.396 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site