diff options
author | Joe Lawrence <joe.lawrence@stratus.com> | 2014-07-02 15:35:16 -0400 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2014-08-26 15:20:23 -0600 |
commit | eb571eeade2598635f813b3284d02c13a380301e (patch) | |
tree | 539842ad23a4eaae8c272278fd9fea389afa6b93 /drivers/scsi/scsi_error.c | |
parent | 52addcf9d6669fa439387610bc65c92fa0980cef (diff) | |
download | lwn-eb571eeade2598635f813b3284d02c13a380301e.tar.gz lwn-eb571eeade2598635f813b3284d02c13a380301e.zip |
block,scsi: verify return pointer from blk_get_request
The blk-core dead queue checks introduce an error scenario to
blk_get_request that returns NULL if the request queue has been
shutdown. This affects the behavior for __GFP_WAIT callers, who should
verify the return value before dereferencing.
Signed-off-by: Joe Lawrence <joe.lawrence@stratus.com>
Acked-by: Jiri Kosina <jkosina@suse.cz> [for pktdvd]
Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/scsi/scsi_error.c')
-rw-r--r-- | drivers/scsi/scsi_error.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 5db8454474ee..4c433bf47a06 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -1960,6 +1960,8 @@ static void scsi_eh_lock_door(struct scsi_device *sdev) * request becomes available */ req = blk_get_request(sdev->request_queue, READ, GFP_KERNEL); + if (!req) + return; blk_rq_set_block_pc(req); |