Commit c938ab4
net: phy: Manual remove LEDs to ensure correct ordering
If the core is left to remove the LEDs via devm_, it is performed too
late, after the PHY driver is removed from the PHY. This results in
dereferencing a NULL pointer when the LED core tries to turn the LED
off before destroying the LED.
Manually unregister the LEDs at a safe point in phy_remove.
Cc: stable@vger.kernel.org
Reported-by: Florian Fainelli <f.fainelli@gmail.com>
Suggested-by: Florian Fainelli <f.fainelli@gmail.com>
Fixes: 01e5b72 ("net: phy: Add a binding for PHY LEDs")
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>1 parent eb09fc2 commit c938ab4
1 file changed
+14
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3021 | 3021 | | |
3022 | 3022 | | |
3023 | 3023 | | |
| 3024 | + | |
| 3025 | + | |
| 3026 | + | |
| 3027 | + | |
| 3028 | + | |
| 3029 | + | |
| 3030 | + | |
| 3031 | + | |
| 3032 | + | |
3024 | 3033 | | |
3025 | 3034 | | |
3026 | 3035 | | |
| |||
3054 | 3063 | | |
3055 | 3064 | | |
3056 | 3065 | | |
3057 | | - | |
| 3066 | + | |
3058 | 3067 | | |
3059 | 3068 | | |
3060 | 3069 | | |
| |||
3083 | 3092 | | |
3084 | 3093 | | |
3085 | 3094 | | |
| 3095 | + | |
3086 | 3096 | | |
3087 | 3097 | | |
3088 | 3098 | | |
| |||
3305 | 3315 | | |
3306 | 3316 | | |
3307 | 3317 | | |
| 3318 | + | |
| 3319 | + | |
| 3320 | + | |
3308 | 3321 | | |
3309 | 3322 | | |
3310 | 3323 | | |
| |||
0 commit comments