diff mbox series

[7/7] gobi: Fail if device could not be created

Message ID 20240220224115.1254853-7-denkenz@gmail.com (mailing list archive)
State Superseded
Headers show
Series [1/7] qmi: Remove qmi_device_sync | expand

Commit Message

Denis Kenzior Feb. 20, 2024, 10:41 p.m. UTC
If for some reason the qmux device creation fails, indicate failure
early and do not rely on the 5 second modem powered timeout.
---
 plugins/gobi.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/plugins/gobi.c b/plugins/gobi.c
index e22b8146cf93..4134c62d398e 100644
--- a/plugins/gobi.c
+++ b/plugins/gobi.c
@@ -431,6 +431,8 @@  static int gobi_enable(struct ofono_modem *modem)
 		return -EINVAL;
 
 	data->device = qmi_device_new_qmux(device);
+	if (!data->device)
+		return -EIO;
 
 	if (getenv("OFONO_QMI_DEBUG"))
 		qmi_device_set_debug(data->device, gobi_debug, "QMI: ");