Commit 8030aa3
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: 7719a68 ("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>1 parent e5c46fd commit 8030aa3
1 file changed
Lines changed: 2 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
493 | 493 | | |
494 | 494 | | |
495 | 495 | | |
496 | | - | |
497 | | - | |
498 | | - | |
499 | | - | |
500 | | - | |
| 496 | + | |
501 | 497 | | |
502 | | - | |
503 | 498 | | |
504 | 499 | | |
505 | 500 | | |
| |||
546 | 541 | | |
547 | 542 | | |
548 | 543 | | |
| 544 | + | |
549 | 545 | | |
550 | 546 | | |
551 | 547 | | |
| |||
0 commit comments