Skip to content
Commit 0e7ce23a authored by Yang Yingliang's avatar Yang Yingliang Committed by Paolo Abeni
Browse files

net: ehea: fix possible memory leak in ehea_register_port()



If of_device_register() returns error, the of node and the
name allocated in dev_set_name() is leaked, call put_device()
to give up the reference that was set in device_initialize(),
so that of node is put in logical_port_release() and the name
is freed in kobject_cleanup().

Fixes: 1acf2318 ("ehea: dynamic add / remove port")
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20221025130011.1071357-1-yangyingliang@huawei.com


Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 89049273
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment