From 3567e6f9eaa258f7689caf1db524ec3e6b475f79 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 6 Mar 2012 11:38:03 -0600 Subject: [PATCH] core: remove some redundant code and add some argument checks ifindex is already passed to the function, no need to look it up again. --- src/nm-manager.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/nm-manager.c b/src/nm-manager.c index f660378a0a..efdd0f462f 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -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 */