ruanjinjie 3cc4c2f6c2 powerpc/pseries: fix possible memory leak in ibmebus_bus_init()
[ Upstream commit afda85b963c12947e298ad85d757e333aa40fd74 ]

If device_register() returns error in ibmebus_bus_init(), name of kobject
which is allocated in dev_set_name() called in device_add() is leaked.

As comment of device_add() says, it should call put_device() to drop
the reference count that was set in device_initialize() when it fails,
so the name can be freed in kobject_cleanup().

Signed-off-by: ruanjinjie <ruanjinjie@huawei.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20221110011929.3709774-1-ruanjinjie@huawei.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-09-23 10:48:16 +02:00
..
2023-09-23 10:47:57 +02:00
2023-02-06 07:49:45 +01:00
2023-08-11 11:45:37 +02:00
2023-09-23 10:48:09 +02:00
2023-08-08 19:49:17 +02:00