Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 75bd2ef1 authored by Jonathan Corbet's avatar Jonathan Corbet
Browse files

bsg: cdev lock_kernel() pushdown



Push the cdev lock_kernel call into bsg_open().

Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
parent b8291ad0
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
#include <linux/uio.h>
#include <linux/idr.h>
#include <linux/bsg.h>
#include <linux/smp_lock.h>

#include <scsi/scsi.h>
#include <scsi/scsi_ioctl.h>
@@ -834,7 +835,11 @@ static struct bsg_device *bsg_get_device(struct inode *inode, struct file *file)

static int bsg_open(struct inode *inode, struct file *file)
{
	struct bsg_device *bd = bsg_get_device(inode, file);
	struct bsg_device *bd;

	lock_kernel();
	bd = bsg_get_device(inode, file);
	unlock_kernel();

	if (IS_ERR(bd))
		return PTR_ERR(bd);