summaryrefslogtreecommitdiffstats
path: root/drivers/block/pktcdvd.c
diff options
context:
space:
mode:
authorJoe Lawrence2014-07-02 21:35:16 +0200
committerJens Axboe2014-08-26 23:20:23 +0200
commiteb571eeade2598635f813b3284d02c13a380301e (patch)
tree539842ad23a4eaae8c272278fd9fea389afa6b93 /drivers/block/pktcdvd.c
parentLinux 3.17-rc2 (diff)
downloadkernel-qcow2-linux-eb571eeade2598635f813b3284d02c13a380301e.tar.gz
kernel-qcow2-linux-eb571eeade2598635f813b3284d02c13a380301e.tar.xz
kernel-qcow2-linux-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/block/pktcdvd.c')
-rw-r--r--drivers/block/pktcdvd.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index 758ac442c5b5..7fa8c80e8982 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -704,6 +704,8 @@ static int pkt_generic_packet(struct pktcdvd_device *pd, struct packet_command *
rq = blk_get_request(q, (cgc->data_direction == CGC_DATA_WRITE) ?
WRITE : READ, __GFP_WAIT);
+ if (!rq)
+ return -ENODEV;
blk_rq_set_block_pc(rq);
if (cgc->buflen) {