From 46836533e01d5ea8e63d9f8e0edfa255a345052b Mon Sep 17 00:00:00 2001 From: "Gustavo F. Padovan" Date: Thu, 11 Feb 2010 20:52:41 -0200 Subject: [PATCH] hfp: avoid crash when hfp is declared on modem.conf --- plugins/hfp.c | 4 ++++ 1 file changed, 4 insertions(+) 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); -- 2.7.4