diff options
author | Jiří Klimeš <jklimes@redhat.com> | 2013-03-13 09:28:38 +0100 |
---|---|---|
committer | Jiří Klimeš <jklimes@redhat.com> | 2013-03-13 09:34:51 +0100 |
commit | cc66b547cfcc7b7dcc45c4c47fccec2c483d225d (patch) | |
tree | 0a3df94399581ac8e45c4dba8bd1ca9499b217d0 /src | |
parent | 44bcc990f785b36996f28f07e44a919fc2895457 (diff) | |
download | NetworkManager-cc66b547cfcc7b7dcc45c4c47fccec2c483d225d.tar.gz |
device: do not call nm_system_iface_set_up() with invalid index (rh #920145)
in hw_take_down()
usb 1-3: USB disconnect, device number 6
modem-manager[547]: <info> (tty/ttyACM0): released by modem /sys/devices/pci0000:00/0000:00:1a.7/usb1/1-3
<info> (tty/ttyACM0): released by modem /sys/devices/pci0000:00/0000:00:1a.7/usb1/1-3
<info> (ttyACM0): device state change: disconnected -> unmanaged (reason 'removed') [30 10 36]
<info> (ttyACM0): cleaning up...
<info> (ttyACM0): taking down device.
nm_system_iface_set_up: assertion `ifindex > 0' failed
Diffstat (limited to 'src')
-rw-r--r-- | src/nm-device.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nm-device.c b/src/nm-device.c index ab0d130795..4b9b9737e3 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -4339,7 +4339,10 @@ nm_device_hw_take_down (NMDevice *self, gboolean block) static void hw_take_down (NMDevice *device) { - nm_system_iface_set_up (nm_device_get_ip_ifindex (device), FALSE, NULL); + int ifindex = nm_device_get_ip_ifindex (device); + + if (ifindex > 0) + nm_system_iface_set_up (ifindex, FALSE, NULL); } static gboolean |