diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-07-19 17:18:00 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-07-19 17:18:00 -0400 |
commit | fdbd55fdde3155a53ee90a60cdc0a4c7ac4f236b (patch) | |
tree | 42cc0005ee1f75dd90a50bc9c00ea7a20233d956 | |
parent | 8bff839927f45731d7d6c6a9a5411670866db122 (diff) | |
parent | 1278dd6809b11dc298e19d81ac0916275f7318c1 (diff) |
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
-rw-r--r-- | drivers/scsi/scsi_sysfs.c | 2 | ||||
-rw-r--r-- | drivers/scsi/st.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c index 1ac38e73df7e..9ad41168d26d 100644 --- a/drivers/scsi/scsi_sysfs.c +++ b/drivers/scsi/scsi_sysfs.c | |||
@@ -859,7 +859,7 @@ sdev_store_queue_depth(struct device *dev, struct device_attribute *attr, | |||
859 | 859 | ||
860 | depth = simple_strtoul(buf, NULL, 0); | 860 | depth = simple_strtoul(buf, NULL, 0); |
861 | 861 | ||
862 | if (depth < 1 || depth > sht->can_queue) | 862 | if (depth < 1 || depth > sdev->host->can_queue) |
863 | return -EINVAL; | 863 | return -EINVAL; |
864 | 864 | ||
865 | retval = sht->change_queue_depth(sdev, depth); | 865 | retval = sht->change_queue_depth(sdev, depth); |
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c index 3f25b8fa921d..871f3553987d 100644 --- a/drivers/scsi/st.c +++ b/drivers/scsi/st.c | |||
@@ -1329,9 +1329,9 @@ static int st_open(struct inode *inode, struct file *filp) | |||
1329 | spin_lock(&st_use_lock); | 1329 | spin_lock(&st_use_lock); |
1330 | STp->in_use = 0; | 1330 | STp->in_use = 0; |
1331 | spin_unlock(&st_use_lock); | 1331 | spin_unlock(&st_use_lock); |
1332 | scsi_tape_put(STp); | ||
1333 | if (resumed) | 1332 | if (resumed) |
1334 | scsi_autopm_put_device(STp->device); | 1333 | scsi_autopm_put_device(STp->device); |
1334 | scsi_tape_put(STp); | ||
1335 | return retval; | 1335 | return retval; |
1336 | 1336 | ||
1337 | } | 1337 | } |