mirror of
https://github.com/apache/nuttx.git
synced 2026-10-10 07:40:27 +00:00
drivers/can: fix netdev_lower_carrier_XXX crash for kvaser card
netdev_lower_carrier_XXX can't be called before netdev is registered Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com> Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
This commit is contained in:
parent
a87bb18531
commit
14b62c50f3
1 changed files with 6 additions and 6 deletions
|
|
@ -1665,12 +1665,6 @@ static int kvaser_probe(FAR struct pci_device_s *dev)
|
|||
netdev->quota[NETPKT_RX] = KVASER_RX_QUOTA;
|
||||
netdev->ops = &g_kvaser_net_ops;
|
||||
|
||||
/* Put the interface in the down state. This usually amounts to
|
||||
* resetting the device and/or calling kvaser_sock_ifdown().
|
||||
*/
|
||||
|
||||
kvaser_sock_ifdown(&priv->sja[i].dev);
|
||||
|
||||
/* Register the network interface. */
|
||||
|
||||
ret = netdev_lower_register(netdev, NET_LL_CAN);
|
||||
|
|
@ -1679,6 +1673,12 @@ static int kvaser_probe(FAR struct pci_device_s *dev)
|
|||
pcierr("ERROR: failed to register count=%d, %d\n", i, ret);
|
||||
goto errout;
|
||||
}
|
||||
|
||||
/* Put the interface in the down state. This usually amounts to
|
||||
* resetting the device and/or calling kvaser_sock_ifdown().
|
||||
*/
|
||||
|
||||
kvaser_sock_ifdown(&priv->sja[i].dev);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue