Re: [PATCH] block: fix memory leak in disk_register_independent_access_ranges

From: Jens Axboe
Date: Fri Jan 21 2022 - 12:48:58 EST


On Thu, 20 Jan 2022 10:10:25 +0000, Miaoqian Lin wrote:
> kobject_init_and_add() takes reference even when it fails.
> According to the doc of kobject_init_and_add()
>
> If this function returns an error, kobject_put() must be called to
> properly clean up the memory associated with the object.
>
> Fix this issue by adding kobject_put().
> Callback function blk_ia_ranges_sysfs_release() in kobject_put()
> can handle the pointer "iars" properly.
>
> [...]

Applied, thanks!

[1/1] block: fix memory leak in disk_register_independent_access_ranges
commit: c321e650a45c4228cce1107680ac74e06f014906

Best regards,
--
Jens Axboe