mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-02-06 17:12:01 +08:00
[netdev] Add check if netdev->ops is null (#7362)
This commit is contained in:
@@ -389,7 +389,7 @@ void netdev_set_default(struct netdev *netdev)
|
||||
netdev_default = netdev;
|
||||
|
||||
/* execture the default network interface device in the current network stack */
|
||||
if (netdev->ops->set_default)
|
||||
if (netdev->ops && netdev->ops->set_default)
|
||||
{
|
||||
netdev->ops->set_default(netdev);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user