nbd: factor out a helper to get nbd_config without holding 'config_lock'
authorLi Nan <linan122@huawei.com>
Thu, 16 Nov 2023 16:23:15 +0000 (00:23 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Dec 2023 16:01:56 +0000 (17:01 +0100)
commit8c1517344116cc47bdde5fb9b140189e7938a74c
tree2e893096d338ed414f98d05a512e33d87ebda0f1
parent4087936a97b899efa0f51d5b71f31f52cd34f302
nbd: factor out a helper to get nbd_config without holding 'config_lock'

[ Upstream commit 3123ac77923341774ca3ad1196ad20bb0732bf70 ]

There are no functional changes, just to make code cleaner and prepare
to fix null-ptr-dereference while accessing 'nbd->config'.

Signed-off-by: Li Nan <linan122@huawei.com>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Link: https://lore.kernel.org/r/20231116162316.1740402-3-linan666@huaweicloud.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/block/nbd.c