Commit 5ebdc6b
phy: core: Fix an OF node refcount leakage in _of_phy_get()
_of_phy_get() will directly return when suffers of_device_is_compatible()
error, but it forgets to decrease refcount of OF node @args.np before error
return, the refcount was increased by previous of_parse_phandle_with_args()
so causes the OF node's refcount leakage.
Fix by decreasing the refcount via of_node_put() before the error return.
Fixes: b7563e2 ("phy: work around 'phys' references to usb-nop-xceiv devices")
Cc: [email protected]
Reviewed-by: Johan Hovold <[email protected]>
Signed-off-by: Zijun Hu <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Vinod Koul <[email protected]>1 parent 4dc48c8 commit 5ebdc6b
1 file changed
+5
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
629 | 629 | | |
630 | 630 | | |
631 | 631 | | |
632 | | - | |
633 | | - | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
634 | 636 | | |
635 | 637 | | |
636 | 638 | | |
| |||
652 | 654 | | |
653 | 655 | | |
654 | 656 | | |
| 657 | + | |
655 | 658 | | |
656 | 659 | | |
657 | 660 | | |
| |||
0 commit comments