diff options
Diffstat (limited to 'drivers/block/ub.c')
-rw-r--r-- | drivers/block/ub.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/block/ub.c b/drivers/block/ub.c index aaf27fb4efd6..102ed52d0e0f 100644 --- a/drivers/block/ub.c +++ b/drivers/block/ub.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/timer.h> | 28 | #include <linux/timer.h> |
29 | #include <linux/scatterlist.h> | 29 | #include <linux/scatterlist.h> |
30 | #include <linux/slab.h> | 30 | #include <linux/slab.h> |
31 | #include <linux/smp_lock.h> | ||
31 | #include <scsi/scsi.h> | 32 | #include <scsi/scsi.h> |
32 | 33 | ||
33 | #define DRV_NAME "ub" | 34 | #define DRV_NAME "ub" |
@@ -1729,8 +1730,13 @@ static int ub_bd_ioctl(struct block_device *bdev, fmode_t mode, | |||
1729 | { | 1730 | { |
1730 | struct gendisk *disk = bdev->bd_disk; | 1731 | struct gendisk *disk = bdev->bd_disk; |
1731 | void __user *usermem = (void __user *) arg; | 1732 | void __user *usermem = (void __user *) arg; |
1733 | int ret; | ||
1734 | |||
1735 | lock_kernel(); | ||
1736 | ret = scsi_cmd_ioctl(disk->queue, disk, mode, cmd, usermem); | ||
1737 | unlock_kernel(); | ||
1732 | 1738 | ||
1733 | return scsi_cmd_ioctl(disk->queue, disk, mode, cmd, usermem); | 1739 | return ret; |
1734 | } | 1740 | } |
1735 | 1741 | ||
1736 | /* | 1742 | /* |
@@ -1794,7 +1800,7 @@ static const struct block_device_operations ub_bd_fops = { | |||
1794 | .owner = THIS_MODULE, | 1800 | .owner = THIS_MODULE, |
1795 | .open = ub_bd_open, | 1801 | .open = ub_bd_open, |
1796 | .release = ub_bd_release, | 1802 | .release = ub_bd_release, |
1797 | .locked_ioctl = ub_bd_ioctl, | 1803 | .ioctl = ub_bd_ioctl, |
1798 | .media_changed = ub_bd_media_changed, | 1804 | .media_changed = ub_bd_media_changed, |
1799 | .revalidate_disk = ub_bd_revalidate, | 1805 | .revalidate_disk = ub_bd_revalidate, |
1800 | }; | 1806 | }; |