wifi: assert against returning cached NMSupplicantInterface instances

nm_supplicant_manager_iface_get() returning a cached instance leads to
a crash when the first owner releases the object, as no ownership is
transferred.

That was fixed on master by commit f1fba3eb02.
Instead of backporting the entire refactoring (which also asserts against
reuse), just disallow reusing here.

The assertion should not be hit. If it would we need to investigate.
Also, this way the assertion avoids a hard crash.

https://bugzilla.redhat.com/show_bug.cgi?id=1298007
This commit is contained in:
Thomas Haller 2016-01-21 15:03:44 +01:00
parent 69e8b4678d
commit bd27102277

View file

@ -93,7 +93,10 @@ nm_supplicant_manager_iface_get (NMSupplicantManager * self,
iface);
}
} else {
nm_log_dbg (LOGD_SUPPLICANT, "(%s): returning existing supplicant interface", ifname);
/* nm_supplicant_manager_iface_get() and release() implements no form of ref-counting
* to properly handle reusing a cached instance. It's also unclear whether that is
* even necessary or desired. Assert here and error out (rh #1298007). */
g_return_val_if_reached (NULL);
}
return iface;