device: fix ref leak in controller_release_port when detach completes synchronously

When detach_port() returns a value other than NM_TERNARY_DEFAULT,
the g_object_ref(port) passed as user_data for the async callback
is never released.

Fixes: 07dc237e5c ('device: wait port detach before leaving the DEACTIVATING state')
This commit is contained in:
Beniamino Galvani 2026-05-30 18:59:17 +02:00
parent cb71852c20
commit e7a211caa1

View file

@ -7278,6 +7278,8 @@ nm_device_controller_release_port(NMDevice *self,
if (ret == NM_TERNARY_DEFAULT) {
port_priv->port_detach_count++;
port_priv->port_detach_reason = reason;
} else {
g_object_unref(port);
}
}