提交 95eeb5f5 编写于 作者: C Christoph Hellwig

scsi: handle command allocation failure in scsi_reset_provider

Signed-off-by: NChristoph Hellwig <hch@lst.de>
Reviewed-by: NNicholas Bellinger <nab@linux-iscsi.org>
Reviewed-by: NMike Christie <michaelc@cs.wisc.edu>
Reviewed-by: NHannes Reinecke <hare@suse.de>
上级 a1b73fc1
...@@ -2306,6 +2306,12 @@ scsi_reset_provider(struct scsi_device *dev, int flag) ...@@ -2306,6 +2306,12 @@ scsi_reset_provider(struct scsi_device *dev, int flag)
} }
scmd = scsi_get_command(dev, GFP_KERNEL); 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); blk_rq_init(NULL, &req);
scmd->request = &req; scmd->request = &req;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册