summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2010-10-24 17:14:16 +0200
committerMarcel Holtmann <marcel@holtmann.org>2010-10-24 17:14:16 +0200
commit3342af770aeaec51735a68c2bebd074d008868ff (patch)
tree598321d99caaae167947ddf5e3a0cda535c7b09f /src
parent9bebe654e3ae2236b73468cfc10300a6e2487984 (diff)
downloadofono-3342af770aeaec51735a68c2bebd074d008868ff.tar.bz2
gprs: Handle failure of GPRS context atom drivers
The GRPS context atom drivers can return an error from their probe callbacks. In that case gc->driver is NULL and will cause a crash when trying to activate a context. So check that there is actually a driver attached to that GPRS context.
Diffstat (limited to 'src')
-rw-r--r--src/gprs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gprs.c b/src/gprs.c
index 3f085ed3..f44838a8 100644
--- a/src/gprs.c
+++ b/src/gprs.c
@@ -714,7 +714,8 @@ static DBusMessage *pri_set_property(DBusConnection *conn,
if (g_str_equal(property, "Active")) {
struct ofono_gprs_context *gc = ctx->gprs->context_driver;
- if (gc == NULL || gc->driver->activate_primary == NULL ||
+ if (gc == NULL || gc->driver == NULL ||
+ gc->driver->activate_primary == NULL ||
gc->driver->deactivate_primary == NULL ||
ctx->gprs->cid_map == NULL)
return __ofono_error_not_implemented(msg);