diff options
author | Miaoqian Lin <[email protected]> | 2022-01-20 10:10:25 +0000 |
---|---|---|
committer | Jens Axboe <[email protected]> | 2022-01-23 09:13:09 -0700 |
commit | 83114df32ae779df57e0af99a8ba6c3968b2ba3d (patch) | |
tree | 5874ade6731fa6ce555079d29b7c1d29a41a06a3 /drivers/usb/cdns3/cdns3-ep0.c | |
parent | dd81e1c7d5fb126e5fbc5c9e334d7b3ec29a16a0 (diff) |
block: fix memory leak in disk_register_independent_access_ranges
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.
Fixes: a2247f19ee1c ("block: Add independent access ranges support")
Signed-off-by: Miaoqian Lin <[email protected]>
Reviewed-by: Damien Le Moal <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'drivers/usb/cdns3/cdns3-ep0.c')
0 files changed, 0 insertions, 0 deletions