Skip to content

Commit 1ddb815

Browse files
Dan Carpenteraxboe
authored andcommitted
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: c9b5645 ("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>
1 parent daa2460 commit 1ddb815

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/block/rnbd/rnbd-clt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ struct rnbd_clt_dev {
112112
struct rnbd_queue *hw_queues;
113113
u32 device_id;
114114
/* local Idr index - used to track minor number allocations. */
115-
u32 clt_device_id;
115+
int clt_device_id;
116116
struct mutex lock;
117117
enum rnbd_clt_dev_state dev_state;
118118
refcount_t refcount;

0 commit comments

Comments
 (0)