diff options
Diffstat (limited to 'drivers/block/ub.c')
-rw-r--r-- | drivers/block/ub.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/block/ub.c b/drivers/block/ub.c index c688c25992e4..8eb44a55b9b8 100644 --- a/drivers/block/ub.c +++ b/drivers/block/ub.c | |||
@@ -1651,15 +1651,11 @@ static void ub_revalidate(struct ub_dev *sc, struct ub_lun *lun) | |||
1651 | static int ub_bd_open(struct inode *inode, struct file *filp) | 1651 | static int ub_bd_open(struct inode *inode, struct file *filp) |
1652 | { | 1652 | { |
1653 | struct gendisk *disk = inode->i_bdev->bd_disk; | 1653 | struct gendisk *disk = inode->i_bdev->bd_disk; |
1654 | struct ub_lun *lun; | 1654 | struct ub_lun *lun = disk->private_data; |
1655 | struct ub_dev *sc; | 1655 | struct ub_dev *sc = lun->udev; |
1656 | unsigned long flags; | 1656 | unsigned long flags; |
1657 | int rc; | 1657 | int rc; |
1658 | 1658 | ||
1659 | if ((lun = disk->private_data) == NULL) | ||
1660 | return -ENXIO; | ||
1661 | sc = lun->udev; | ||
1662 | |||
1663 | spin_lock_irqsave(&ub_lock, flags); | 1659 | spin_lock_irqsave(&ub_lock, flags); |
1664 | if (atomic_read(&sc->poison)) { | 1660 | if (atomic_read(&sc->poison)) { |
1665 | spin_unlock_irqrestore(&ub_lock, flags); | 1661 | spin_unlock_irqrestore(&ub_lock, flags); |