mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-05 00:38:07 +02:00
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:
parent
69e8b4678d
commit
bd27102277
1 changed files with 4 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue