aboutsummaryrefslogtreecommitdiff
path: root/lib/mpi/mpi-add.c
diff options
context:
space:
mode:
authorVladimir Oltean <[email protected]>2022-11-29 16:12:13 +0200
committerPaolo Abeni <[email protected]>2022-12-01 13:40:22 +0100
commitccbd7822950fe9c7212d85a140ea18174f9b2c0f (patch)
treeb44b1efc2edaa75bda69d71a9793ac33557972c1 /lib/mpi/mpi-add.c
parent3853338881541093ce708beb6f26ce74b2a4fe0e (diff)
net: dpaa2-mac: remove defensive check in dpaa2_mac_disconnect()
dpaa2_mac_disconnect() will only be called with a NULL mac->phylink if dpaa2_mac_connect() failed, or was never called. The callers are these: dpaa2_eth_disconnect_mac(): if (dpaa2_eth_is_type_phy(priv)) dpaa2_mac_disconnect(priv->mac); dpaa2_switch_port_disconnect_mac(): if (dpaa2_switch_port_is_type_phy(port_priv)) dpaa2_mac_disconnect(port_priv->mac); priv->mac can be NULL, but in that case, dpaa2_eth_is_type_phy() returns false, and dpaa2_mac_disconnect() is never called. Similar for dpaa2-switch. When priv->mac is non-NULL, it means that dpaa2_mac_connect() returned zero (success), and therefore, priv->mac->phylink is also a valid pointer. Signed-off-by: Vladimir Oltean <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Reviewed-by: Ioana Ciornei <[email protected]> Tested-by: Ioana Ciornei <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
Diffstat (limited to 'lib/mpi/mpi-add.c')
0 files changed, 0 insertions, 0 deletions