LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [UNTESTED PATCH] block: fix a potential null pointer dereference
@ 2019-05-24  5:35 Peng Wang
  0 siblings, 0 replies; only message in thread
From: Peng Wang @ 2019-05-24  5:35 UTC (permalink / raw)
  To: axboe; +Cc: linux-block, linux-kernel, Peng Wang

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-05-24  6:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-24  5:35 [UNTESTED PATCH] block: fix a potential null pointer dereference Peng Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).