Skip to content

Fix usage and assumptions of the primary AT port

The logic assumed in multiple places that if an AT-based modem is created because the primary AT port is used as control, this primary AT port always exists. This assumption is right in 99.9% of the cases, except when the device is unplugged abruptly. In this case, the modem object would exist for as long as the last valid reference exists, which may be a reference within a GTask for an ongoing operation. When this happens, mm_base_modem_peek_primary() and mm_base_modem_peek_best_at_port() may return NULL.

These patches rework the whole codebase to expect failures in the peek or get methods for TTYs.

Merge request reports