aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorJoe Lawrence <joe.lawrence@stratus.com>2014-07-02 15:35:16 -0400
committerJens Axboe <axboe@fb.com>2014-08-26 17:20:23 -0400
commiteb571eeade2598635f813b3284d02c13a380301e (patch)
tree539842ad23a4eaae8c272278fd9fea389afa6b93 /drivers/scsi
parent52addcf9d6669fa439387610bc65c92fa0980cef (diff)
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')
-rw-r--r--drivers/scsi/scsi_error.c2
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)
1960 * request becomes available 1960 * request becomes available
1961 */ 1961 */
1962 req = blk_get_request(sdev->request_queue, READ, GFP_KERNEL); 1962 req = blk_get_request(sdev->request_queue, READ, GFP_KERNEL);
1963 if (!req)
1964 return;
1963 1965
1964 blk_rq_set_block_pc(req); 1966 blk_rq_set_block_pc(req);
1965 1967