diff options
author | John Garry <john.garry@huawei.com> | 2021-10-05 18:23:26 +0800 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-10-18 06:17:02 -0600 |
commit | 65de57bb2e66f1fbede166c1307570ebd09eae83 (patch) | |
tree | 4a89cb90b3176b670faee62eae6b724bcb53c402 /block/blk-mq.c | |
parent | 8a3ee6778ef1a9a3bfd3b1134ea29e95d3568271 (diff) | |
download | lwn-65de57bb2e66f1fbede166c1307570ebd09eae83.tar.gz lwn-65de57bb2e66f1fbede166c1307570ebd09eae83.zip |
blk-mq: Change rqs check in blk_mq_free_rqs()
The original code in commit 24d2f90309b23 ("blk-mq: split out tag
initialization, support shared tags") would check tags->rqs is non-NULL and
then dereference tags->rqs[].
Then in commit 2af8cbe30531 ("blk-mq: split tag ->rqs[] into two"), we
started to dereference tags->static_rqs[], but continued to check non-NULL
tags->rqs.
Check tags->static_rqs as non-NULL instead, which is more logical.
Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Link: https://lore.kernel.org/r/1633429419-228500-2-git-send-email-john.garry@huawei.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-mq.c')
-rw-r--r-- | block/blk-mq.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c index 2539ba976949..03cbde75756d 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -2349,7 +2349,7 @@ void blk_mq_free_rqs(struct blk_mq_tag_set *set, struct blk_mq_tags *tags, { struct page *page; - if (tags->rqs && set->ops->exit_request) { + if (tags->static_rqs && set->ops->exit_request) { int i; for (i = 0; i < tags->nr_tags; i++) { |