Skip to content

Commit fdbd55f

Browse files
committed
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI fixes from James Bottomley: "Two fairly simple fixes: one is a change that causes us to have a very low queue depth leading to performance issues and the other is a null deref occasionally in tapes thanks to use after put" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: fix host max depth checking for the 'queue_depth' sysfs interface st: null pointer dereference panic caused by use after kref_put by st_open
2 parents 8bff839 + 1278dd6 commit fdbd55f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/scsi/scsi_sysfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,7 @@ sdev_store_queue_depth(struct device *dev, struct device_attribute *attr,
859859

860860
depth = simple_strtoul(buf, NULL, 0);
861861

862-
if (depth < 1 || depth > sht->can_queue)
862+
if (depth < 1 || depth > sdev->host->can_queue)
863863
return -EINVAL;
864864

865865
retval = sht->change_queue_depth(sdev, depth);

drivers/scsi/st.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1329,9 +1329,9 @@ static int st_open(struct inode *inode, struct file *filp)
13291329
spin_lock(&st_use_lock);
13301330
STp->in_use = 0;
13311331
spin_unlock(&st_use_lock);
1332-
scsi_tape_put(STp);
13331332
if (resumed)
13341333
scsi_autopm_put_device(STp->device);
1334+
scsi_tape_put(STp);
13351335
return retval;
13361336

13371337
}

0 commit comments

Comments
 (0)