]> git.baikalelectronics.ru Git - kernel.git/commit
blk-mq: Change rqs check in blk_mq_free_rqs()
authorJohn Garry <john.garry@huawei.com>
Tue, 5 Oct 2021 10:23:26 +0000 (18:23 +0800)
committerJens Axboe <axboe@kernel.dk>
Mon, 18 Oct 2021 12:17:02 +0000 (06:17 -0600)
commit27e21c62fcc7eb2e3ab4bddb6493ecd484096471
tree4a89cb90b3176b670faee62eae6b724bcb53c402
parent033ad426a678b67d1f2c300c221cb0bbad9f5d24
blk-mq: Change rqs check in blk_mq_free_rqs()

The original code in commit fdc3015747062 ("blk-mq: split out tag
initialization, support shared tags") would check tags->rqs is non-NULL and
then dereference tags->rqs[].

Then in commit 9a2b5d2e9bf8 ("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>
block/blk-mq.c