]> git.baikalelectronics.ru Git - kernel.git/commit
block/rnbd-clt: fix wrong max ID in ida_alloc_max
authorGuoqing Jiang <guoqing.jiang@linux.dev>
Fri, 30 Dec 2022 01:09:26 +0000 (09:09 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Feb 2023 07:34:21 +0000 (08:34 +0100)
commit77d3e3c942d237ac45fa88a5b0591eb37d2a26c6
tree3901e0e3554b629c1d4dc160f3aede3c647d5879
parent7ebe7fb0baf3694c43d0cb26b248997dc98de1b9
block/rnbd-clt: fix wrong max ID in ida_alloc_max

[ Upstream commit 9d6033e350694a67885605674244d43c9559dc36 ]

We need to pass 'end - 1' to ida_alloc_max after switch from
ida_simple_get to ida_alloc_max.

Otherwise smatch warns.

drivers/block/rnbd/rnbd-clt.c:1460 init_dev() error: Calling ida_alloc_max() with a 'max' argument which is a power of 2. -1 missing?

Fixes: f67491d5b4b2 ("block/rnbd: Remove a useless mutex")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Guoqing Jiang <guoqing.jiang@linux.dev>
Acked-by: Jack Wang <jinpu.wang@ionos.com>
Link: https://lore.kernel.org/r/20221230010926.32243-1-guoqing.jiang@linux.dev
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/block/rnbd/rnbd-clt.c