forked from mirrors/linux
		
	net: phy: Fix missing of_node_put() for leds
The call of of_get_child_by_name() will cause refcount incremented
for leds, if it succeeds, it should call of_node_put() to decrease
it, fix it.
Fixes: 01e5b728e9 ("net: phy: Add a binding for PHY LEDs")
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/20240830022025.610844-1-ruanjinjie@huawei.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
			
			
This commit is contained in:
		
							parent
							
								
									c2eb062653
								
							
						
					
					
						commit
						2560db6ede
					
				
					 1 changed files with 2 additions and 0 deletions
				
			
		|  | @ -3347,11 +3347,13 @@ static int of_phy_leds(struct phy_device *phydev) | |||
| 		err = of_phy_led(phydev, led); | ||||
| 		if (err) { | ||||
| 			of_node_put(led); | ||||
| 			of_node_put(leds); | ||||
| 			phy_leds_unregister(phydev); | ||||
| 			return err; | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	of_node_put(leds); | ||||
| 	return 0; | ||||
| } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue
	
	 Jinjie Ruan
						Jinjie Ruan