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>
This commit is contained in:
Christoph Hellwig 2014-05-01 16:51:05 +02:00
parent a1b73fc194
commit 95eeb5f588

View File

@ -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;