This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 14b62c50f37dc954383f97d265f968bfede5eef5
Author: p-szafonimateusz <[email protected]>
AuthorDate: Tue Mar 17 11:47:15 2026 +0100

    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 <[email protected]>
    Signed-off-by: dongjiuzhu1 <[email protected]>
---
 drivers/can/kvaser_pci.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/can/kvaser_pci.c b/drivers/can/kvaser_pci.c
index 1cd70eaa1e5..7e2760f54f8 100644
--- a/drivers/can/kvaser_pci.c
+++ b/drivers/can/kvaser_pci.c
@@ -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
     }
 

Reply via email to