public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH next] block: rnbd-clt: Fix signedness bug in init_dev()
@ 2025-12-20  8:46 Dan Carpenter
  2025-12-20 20:25 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2025-12-20  8:46 UTC (permalink / raw)
  To: Thomas Fourier
  Cc: Md. Haris Iqbal, Jack Wang, Jens Axboe, linux-block, linux-kernel,
	kernel-janitors

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>
---
 drivers/block/rnbd/rnbd-clt.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/block/rnbd/rnbd-clt.h b/drivers/block/rnbd/rnbd-clt.h
index a48e040abe63..fbc1ed766025 100644
--- a/drivers/block/rnbd/rnbd-clt.h
+++ b/drivers/block/rnbd/rnbd-clt.h
@@ -112,7 +112,7 @@ struct rnbd_clt_dev {
 	struct rnbd_queue	*hw_queues;
 	u32			device_id;
 	/* local Idr index - used to track minor number allocations. */
-	u32			clt_device_id;
+	int			clt_device_id;
 	struct mutex		lock;
 	enum rnbd_clt_dev_state	dev_state;
 	refcount_t		refcount;
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH next] block: rnbd-clt: Fix signedness bug in init_dev()
  2025-12-20  8:46 [PATCH next] block: rnbd-clt: Fix signedness bug in init_dev() Dan Carpenter
@ 2025-12-20 20:25 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2025-12-20 20:25 UTC (permalink / raw)
  To: Thomas Fourier, Dan Carpenter
  Cc: Md. Haris Iqbal, Jack Wang, linux-block, linux-kernel,
	kernel-janitors


On Sat, 20 Dec 2025 11:46:10 +0300, Dan Carpenter wrote:
> 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.
> 
> 

Applied, thanks!

[1/1] block: rnbd-clt: Fix signedness bug in init_dev()
      commit: 1ddb815fdfd45613c32e9bd1f7137428f298e541

Best regards,
-- 
Jens Axboe




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-12-20 20:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-20  8:46 [PATCH next] block: rnbd-clt: Fix signedness bug in init_dev() Dan Carpenter
2025-12-20 20:25 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox