Commit 95eeb5f5 authored by Christoph Hellwig's avatar Christoph Hellwig

scsi: handle command allocation failure in scsi_reset_provider

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
Reviewed-by: default avatarMike Christie <michaelc@cs.wisc.edu>
Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
parent a1b73fc1
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment