Skip to content

Commit

Permalink
scsi: handle command allocation failure in scsi_reset_provider
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christoph Hellwig committed May 19, 2014
1 parent a1b73fc commit 95eeb5f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/scsi/scsi_error.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 95eeb5f

Please sign in to comment.