Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

block: rnbd-clt: Fix signedness bug in init_dev()

The "dev->clt_device_id" variable is set using ida_alloc_max() which
returns an int and in particular it returns negative error codes.
Change the type from u32 to int to fix the error checking.

Fixes: c9b5645fd8ca ("block: rnbd-clt: Fix leaked ID in init_dev()")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Dan Carpenter and committed by
Jens Axboe
1ddb815f daa24603

+1 -1
+1 -1
drivers/block/rnbd/rnbd-clt.h
··· 112 112 struct rnbd_queue *hw_queues; 113 113 u32 device_id; 114 114 /* local Idr index - used to track minor number allocations. */ 115 - u32 clt_device_id; 115 + int clt_device_id; 116 116 struct mutex lock; 117 117 enum rnbd_clt_dev_state dev_state; 118 118 refcount_t refcount;