[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20190524053520.30963-1-rocking@whu.edu.cn>
Date: Fri, 24 May 2019 13:35:20 +0800
From: Peng Wang <rocking@....edu.cn>
To: axboe@...nel.dk
Cc: linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
Peng Wang <rocking@....edu.cn>
Subject: [UNTESTED PATCH] block: fix a potential null pointer dereference
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@....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
Powered by blists - more mailing lists