mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-26 15:03:53 +01:00
gnrc_netif: Check return value of netdev init during thread start
This commit is contained in:
parent
bc667ec3e0
commit
6d6a6efac7
@ -1291,7 +1291,17 @@ static void *_gnrc_netif_thread(void *args)
|
||||
dev->event_callback = _event_cb;
|
||||
dev->context = netif;
|
||||
/* initialize low-level driver */
|
||||
dev->driver->init(dev);
|
||||
res = dev->driver->init(dev);
|
||||
if (res < 0) {
|
||||
LOG_ERROR("gnrc_netif: netdev init failed: %d\n", res);
|
||||
/* unregister this netif instance */
|
||||
netif->ops = NULL;
|
||||
netif->pid = KERNEL_PID_UNDEF;
|
||||
netif->dev = NULL;
|
||||
dev->event_callback = NULL;
|
||||
dev->context = NULL;
|
||||
return NULL;
|
||||
}
|
||||
_configure_netdev(dev);
|
||||
_init_from_device(netif);
|
||||
netif->cur_hl = GNRC_NETIF_DEFAULT_HL;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user