Commit a7fdaf0
net: mana: Don't overwrite port probe error with add_adev result
In mana_probe(), if mana_probe_port() fails for any port, the error
is stored in 'err' and the loop breaks. However, the subsequent
unconditional 'err = add_adev(gd, "eth")' overwrites this error.
If add_adev() succeeds, mana_probe() returns success despite ports
being left in a partially initialized state (ac->ports[i] == NULL).
Only call add_adev() when there is no prior error, so the probe
correctly fails and triggers mana_remove() cleanup.
Fixes: a69839d ("net: mana: Add support for auxiliary device")
Signed-off-by: Erni Sri Satya Vennela <ernis@linux.microsoft.com>
Link: https://patch.msgid.link/20260420124741.1056179-5-ernis@linux.microsoft.com
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>1 parent 50271d7 commit a7fdaf0
1 file changed
Lines changed: 8 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3680 | 3680 | | |
3681 | 3681 | | |
3682 | 3682 | | |
3683 | | - | |
3684 | | - | |
3685 | | - | |
3686 | | - | |
| 3683 | + | |
| 3684 | + | |
| 3685 | + | |
3687 | 3686 | | |
3688 | 3687 | | |
3689 | 3688 | | |
| |||
3697 | 3696 | | |
3698 | 3697 | | |
3699 | 3698 | | |
3700 | | - | |
3701 | | - | |
3702 | | - | |
3703 | | - | |
| 3699 | + | |
| 3700 | + | |
| 3701 | + | |
3704 | 3702 | | |
3705 | 3703 | | |
3706 | 3704 | | |
| |||
3709 | 3707 | | |
3710 | 3708 | | |
3711 | 3709 | | |
3712 | | - | |
| 3710 | + | |
| 3711 | + | |
3713 | 3712 | | |
3714 | 3713 | | |
3715 | 3714 | | |
| |||
0 commit comments