Re: [PATCH 4/5] usb:Push BKL on open down into the drivers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 13 Jan 2010 15:33:15 +0100
Oliver Neukum <oliver@xxxxxxxxxx> wrote:

> Straightforward push into the drivers to allow
> auditing individual drivers separately

>  #include <linux/mutex.h>
> +#include <linux/smp_lock.h>
>  #undef DEBUG
> @@ -395,6 +396,7 @@ static int usblp_open(struct inode *inode, struct file *file)
> +	lock_kernel();
>  	mutex_lock (&usblp_mutex);
>  	retval = -ENODEV;
> @@ -434,6 +436,7 @@ static int usblp_open(struct inode *inode, struct file *file)
>  out:
>  	mutex_unlock (&usblp_mutex);
> +	unlock_kernel();
>  	return retval;

Might as well drop it form usblp right away, too obvious.
BTW, I always thought of it as "write as if BKL did not apply",
just in case. Don't forget to remove the #include that you added.

-- Pete
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux