OpenCloudOS-Kernel/drivers/dio
Yang Yingliang e63e99397b drivers: dio: fix possible memory leak in dio_init()
If device_register() returns error, the 'dev' and name needs be
freed. Add a release function, and then call put_device() in the
error path, so the name is freed in kobject_cleanup() and to the
'dev' is freed in release function.

Fixes: 2e4c77bea3 ("m68k: dio - Kill warn_unused_result warnings")
Fixes: 1fa5ae857b ("driver core: get rid of struct device's bus_id string array")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20221109064036.1835346-1-yangyingliang@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-11-09 15:12:37 +01:00
..
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
dio-driver.c dio: Fix dio_bus_match() kerneldoc 2020-03-09 11:12:19 +01:00
dio-sysfs.c m68k: dio - Kill resource_size_t format warnings 2009-01-12 20:56:42 +01:00
dio.c drivers: dio: fix possible memory leak in dio_init() 2022-11-09 15:12:37 +01:00