GNOME Bugzilla – Bug 764606
NMManager crash in platform_link_added
Last modified: 2016-04-04 19:29:31 UTC
While testing NM 1.2-beta3, I reproduced the following crash on one of our devices. NMManager's platform_link_added function logs a warning if the factory_create_device operation fails. The log message appends error->message, however it's possible that error == NULL on return from the factory_create_device call.
I just created the following pull-request with a fix: https://github.com/NetworkManager/NetworkManager/pull/5
In most cases, when a function fails, it *must* set the @error argument. For consistency, in case of nm_device_factory_create_device(), the function should always set @error if it returns NULL -- regardless of whether the device is to be ignored or not.
Created attachment 325366 [details] [review] manager: refactor error variable in platform_link_added() Free the error via gs_free_error and create a separate instances.
Created attachment 325367 [details] [review] device: ensure @error always set by nm_device_factory_create_device()
LGTM, but perhaps update the error message text to also indicate that the plugin may want the core to ignore the device. It's not necessarily that the plugin cannot create the device, it's that the kernel interface is part of an already-existing device (like a WWAN modem or bluetooth device) and the plugin handles it internally via ip_iface, rather than having a full NMDevice.
merged to master: https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=c5d827057e71e349a02922982323d2e8a85081c8