Skip to content

Commit 95eeb5f

Browse files
author
Christoph Hellwig
committed
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>
1 parent a1b73fc commit 95eeb5f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/scsi/scsi_error.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2306,6 +2306,12 @@ scsi_reset_provider(struct scsi_device *dev, int flag)
23062306
}
23072307

23082308
scmd = scsi_get_command(dev, GFP_KERNEL);
2309+
if (!scmd) {
2310+
rtn = FAILED;
2311+
put_device(&dev->sdev_gendev);
2312+
goto out_put_autopm_host;
2313+
}
2314+
23092315
blk_rq_init(NULL, &req);
23102316
scmd->request = &req;
23112317

0 commit comments

Comments
 (0)