summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGustavo F. Padovan <padovan@profusion.mobi>2010-02-11 20:52:41 -0200
committerDenis Kenzior <denkenz@gmail.com>2010-02-11 17:03:31 -0600
commit46836533e01d5ea8e63d9f8e0edfa255a345052b (patch)
tree7562e263659e88dc1c684a643d368c7521275901
parent8f95e03d752ec2d562c518ee6d1d4fc6383ed23f (diff)
downloadofono-46836533e01d5ea8e63d9f8e0edfa255a345052b.tar.bz2
hfp: avoid crash when hfp is declared on modem.conf
-rw-r--r--plugins/hfp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/plugins/hfp.c b/plugins/hfp.c
index 5e29bba1..d2668e0f 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);