[PATCH 2/3] hfp: avoid crash when hfp is declared on modem.conf
Gustavo F. Padovan
padovan at profusion.mobi
Thu Feb 11 14:52:41 PST 2010
---
plugins/hfp.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/plugins/hfp.c b/plugins/hfp.c
index 5e29bba..d2668e0 100644
--- a/plugins/hfp.c
+++ b/plugins/hfp.c
@@ -723,6 +723,10 @@ static int hfp_unregister_ofono_handsfree(struct ofono_modem *modem)
static int hfp_probe(struct ofono_modem *modem)
{
const char *obj_path = ofono_modem_get_path(modem);
+ struct hfp_data *data = ofono_modem_get_data(modem);
+
+ if (!data)
+ return -EINVAL;
g_dbus_register_interface(connection, obj_path, HFP_AGENT_INTERFACE,
agent_methods, NULL, NULL, modem, NULL);
--
1.6.4.4
More information about the ofono
mailing list