diff options
-rw-r--r-- | drivers/scsi/scsi_error.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index a6f6b9222b51..96627bae753c 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c | |||
@@ -2337,14 +2337,9 @@ scsi_ioctl_reset(struct scsi_device *dev, int __user *arg) | |||
2337 | return -EIO; | 2337 | return -EIO; |
2338 | 2338 | ||
2339 | error = -EIO; | 2339 | error = -EIO; |
2340 | if (!get_device(&dev->sdev_gendev)) | ||
2341 | goto out_put_autopm_host; | ||
2342 | |||
2343 | scmd = scsi_get_command(dev, GFP_KERNEL); | 2340 | scmd = scsi_get_command(dev, GFP_KERNEL); |
2344 | if (!scmd) { | 2341 | if (!scmd) |
2345 | put_device(&dev->sdev_gendev); | ||
2346 | goto out_put_autopm_host; | 2342 | goto out_put_autopm_host; |
2347 | } | ||
2348 | 2343 | ||
2349 | blk_rq_init(NULL, &req); | 2344 | blk_rq_init(NULL, &req); |
2350 | scmd->request = &req; | 2345 | scmd->request = &req; |
@@ -2406,10 +2401,10 @@ scsi_ioctl_reset(struct scsi_device *dev, int __user *arg) | |||
2406 | "waking up host to restart after TMF\n")); | 2401 | "waking up host to restart after TMF\n")); |
2407 | 2402 | ||
2408 | wake_up(&shost->host_wait); | 2403 | wake_up(&shost->host_wait); |
2409 | |||
2410 | scsi_run_host_queues(shost); | 2404 | scsi_run_host_queues(shost); |
2411 | 2405 | ||
2412 | scsi_next_command(scmd); | 2406 | scsi_put_command(scmd); |
2407 | |||
2413 | out_put_autopm_host: | 2408 | out_put_autopm_host: |
2414 | scsi_autopm_put_host(shost); | 2409 | scsi_autopm_put_host(shost); |
2415 | return error; | 2410 | return error; |