diff mbox series

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

Message ID 20240221162335.1258315-7-denkenz@gmail.com (mailing list archive)
State Accepted
Commit 2cfc037e723b1ca0e3137b1b296a75d20474bc82
Headers show
Series [v2,1/7] qmi: Remove qmi_device_sync | expand

Commit Message

Denis Kenzior Feb. 21, 2024, 4:23 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: ");