lkml.org 
[lkml]   [2019]   [May]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[UNTESTED PATCH] block: fix a potential null pointer dereference
Date
blk_queue_dying() still needs request_queue "q" when
enter_succeeded is false, so let's set "q" zero later.

Signed-off-by: Peng Wang <rocking@whu.edu.cn>
---
block/blk-core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/blk-core.c b/block/blk-core.c
index 419d600e6637..3d43909db3b8 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1056,7 +1056,6 @@ blk_qc_t generic_make_request(struct bio *bio)
flags = BLK_MQ_REQ_NOWAIT;
if (blk_queue_enter(q, flags) < 0) {
enter_succeeded = false;
- q = NULL;
}
}

@@ -1088,6 +1087,7 @@ blk_qc_t generic_make_request(struct bio *bio)
bio_wouldblock_error(bio);
else
bio_io_error(bio);
+ q = NULL;
}
bio = bio_list_pop(&bio_list_on_stack[0]);
} while (bio);
--
2.19.1
\
 
 \ /
  Last update: 2019-05-24 08:14    [W:0.080 / U:0.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site