CVE-2026-43219: net: cpsw_new: Fix potential unregister of netdev that has not been registered yet
In the Linux kernel, the following vulnerability has been resolved:
net: cpswnew: Fix potential unregister of netdev that has not been registered yet
If an error occurs during registernetdev() for the first MAC in cpswregisterports(), even though cpsw->slaves[0].ndev is set to NULL, cpsw->slaves[1].ndev would remain unchanged. This could later cause cpswunregisterports() to attempt unregistering the second MAC. To address this, add a check for ndev->regstate before calling unregisternetdev(). With this change, setting cpsw->slaves[i].ndev to NULL becomes unnecessary and can be removed accordingly.