mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-09 12:00:36 +01:00
core: remove some redundant code and add some argument checks
ifindex is already passed to the function, no need to look it up again.
This commit is contained in:
parent
cd2c721762
commit
3567e6f9ea
1 changed files with 6 additions and 1 deletions
|
|
@ -2169,7 +2169,12 @@ udev_device_added_cb (NMUdevManager *udev_mgr,
|
|||
GSList *iter;
|
||||
GError *error = NULL;
|
||||
|
||||
ifindex = g_udev_device_get_property_as_int (udev_device, "IFINDEX");
|
||||
g_return_if_fail (udev_device != NULL);
|
||||
g_return_if_fail (iface != NULL);
|
||||
g_return_if_fail (sysfs_path != NULL);
|
||||
g_return_if_fail (driver != NULL);
|
||||
g_return_if_fail (ifindex >= 0);
|
||||
|
||||
device = find_device_by_ifindex (self, ifindex);
|
||||
if (device) {
|
||||
/* If it's a virtual device we may need to update its UDI */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue