]> git.baikalelectronics.ru Git - kernel.git/commit
ARM: 9207/1: amba: fix refcount underflow if amba_device_add() fails
authorWang Kefeng <wangkefeng.wang@huawei.com>
Tue, 24 May 2022 08:03:46 +0000 (09:03 +0100)
committerRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Thu, 14 Jul 2022 12:17:48 +0000 (13:17 +0100)
commitde07763429993f3643ae940fc8ae0faca56cc29d
tree259a370d56344ec99bb7407cd1f3365f473cee51
parent76a7ba9c46ceffc77127314c773db198f72e378f
ARM: 9207/1: amba: fix refcount underflow if amba_device_add() fails

"ARM: 9192/1: amba: fix memory leak in amba_device_try_add()" leads
to a refcount underflow if amba_device_add() fails, which called by
of_amba_device_create(), the of_amba_device_create() already exists
the error handling, so amba_put_device() only need to be added into
amba_deferred_retry().

Fixes: 19051358cbc0 ("ARM: 9192/1: amba: fix memory leak in amba_device_try_add()")
Reported-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
drivers/amba/bus.c