mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-25 03:40:07 +01:00
device: fix wrong assert in NMDeviceFactory
nm_device_factory_manager_find_factory_for_link_type()
easily can see a link-type NM_LINK_TYPE_UNKNOWN because
there are many link types that NetworkManager cannot detect.
Just return NULL early.
Fixes: 71bde20c30
This commit is contained in:
parent
9a49fa7fb1
commit
eb2efaa228
1 changed files with 3 additions and 1 deletions
|
|
@ -302,7 +302,9 @@ nm_device_factory_manager_find_factory_for_link_type (NMLinkType link_type)
|
|||
{
|
||||
const NMLinkType ltypes[2] = { link_type, NM_LINK_TYPE_NONE };
|
||||
|
||||
g_assert (ltypes[0] > NM_LINK_TYPE_UNKNOWN);
|
||||
if (link_type == NM_LINK_TYPE_UNKNOWN)
|
||||
return NULL;
|
||||
g_return_val_if_fail (link_type > NM_LINK_TYPE_UNKNOWN, NULL);
|
||||
return find_factory (ltypes, NULL);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue