aboutsummaryrefslogtreecommitdiff
path: root/lib/mpi/mpi-mod.c
diff options
context:
space:
mode:
authorYang Yingliang <[email protected]>2022-11-04 10:13:34 +0800
committerGreg Kroah-Hartman <[email protected]>2022-11-09 15:40:14 +0100
commit6e63153db50059fb78b8a8447b132664887d24e3 (patch)
treef05355243d5f44fea88507b81ca7eb87e9558946 /lib/mpi/mpi-mod.c
parente5b0d06d9b10f5f43101bd6598b076c347f9295f (diff)
siox: fix possible memory leak in siox_device_add()
If device_register() returns error in siox_device_add(), the name allocated by dev_set_name() need be freed. As comment of device_register() says, it should use put_device() to give up the reference in the error path. So fix this by calling put_device(), then the name can be freed in kobject_cleanup(), and sdevice is freed in siox_device_release(), set it to null in error path. Fixes: bbecb07fa0af ("siox: new driver framework for eckelmann SIOX") Signed-off-by: Yang Yingliang <[email protected]> Reviewed-by: Uwe Kleine-König <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'lib/mpi/mpi-mod.c')
0 files changed, 0 insertions, 0 deletions