diff options
author | Christoph Hellwig <hch@lst.de> | 2014-05-01 16:51:05 +0200 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2014-05-19 12:35:10 +0200 |
commit | 95eeb5f5880cd390fd59710f64dc7b84d1e9942f (patch) | |
tree | 7ef92673ed5c1509f543817b047db2e2fd5e7195 /drivers/scsi/scsi_error.c | |
parent | a1b73fc194e73ed33c8b77bf09374cb05b58151b (diff) |
scsi: handle command allocation failure in scsi_reset_provider
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Nicholas Bellinger <nab@linux-iscsi.org>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Diffstat (limited to 'drivers/scsi/scsi_error.c')
-rw-r--r-- | drivers/scsi/scsi_error.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index f17aa7aa787..abe51eab3dc 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -2306,6 +2306,12 @@ scsi_reset_provider(struct scsi_device *dev, int flag) } scmd = scsi_get_command(dev, GFP_KERNEL); + if (!scmd) { + rtn = FAILED; + put_device(&dev->sdev_gendev); + goto out_put_autopm_host; + } + blk_rq_init(NULL, &req); scmd->request = &req; |