diff options
author | Yang Yingliang <yangyingliang@huawei.com> | 2022-11-10 23:24:41 +0800 |
---|---|---|
committer | Juergen Gross <jgross@suse.com> | 2022-11-14 13:29:07 +0100 |
commit | da36a2a76b01b210ffaa55cdc2c99bc8783697c5 (patch) | |
tree | d0a14248a4941cf124b40ad15601f45dbc326fb1 /tools/testing/selftests/bpf/prog_tests/module_attach.c | |
parent | 639b2e2ff1e850eb4e8853b4dc233875108eec4b (diff) |
xen/pcpu: fix possible memory leak in register_pcpu()
In device_add(), dev_set_name() is called to allocate name, if it returns
error, the 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().
Fixes: f65c9bb3fb72 ("xen/pcpu: Xen physical cpus online/offline sys interface")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Link: https://lore.kernel.org/r/20221110152441.401630-1-yangyingliang@huawei.com
Signed-off-by: Juergen Gross <jgross@suse.com>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/module_attach.c')
0 files changed, 0 insertions, 0 deletions