Skip to content

Commit 8a28af7

Browse files
nrossi-digidavem330
authored andcommitted
net: ethernet: aquantia: Handle error cleanup of start on open
The aq_nic_start function can fail in a variety of cases which leaves the device in broken state. An example case where the start function fails is the request_threaded_irq which can be interrupted, resulting in a EINTR result. This can be manually triggered by bringing the link up (e.g. ip link set up) and triggering a SIGINT on the initiating process (e.g. Ctrl+C). This would put the device into a half configured state. Subsequently bringing the link up again would cause the napi_enable to BUG. In order to correctly clean up the failed attempt to start a device call aq_nic_stop. Signed-off-by: Nathan Rossi <nathan.rossi@digi.com> Reviewed-by: Igor Russkikh <irusskikh@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent b1f1963 commit 8a28af7

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • drivers/net/ethernet/aquantia/atlantic

‎drivers/net/ethernet/aquantia/atlantic/aq_main.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,10 @@ static int aq_ndev_open(struct net_device *ndev)
7171
goto err_exit;
7272

7373
err = aq_nic_start(aq_nic);
74-
if (err < 0)
74+
if (err < 0) {
75+
aq_nic_stop(aq_nic);
7576
goto err_exit;
77+
}
7678

7779
err_exit:
7880
if (err < 0)

0 commit comments

Comments
 (0)