diff options
author | Aki Niemi <aki.niemi@nokia.com> | 2010-10-19 11:28:06 +0300 |
---|---|---|
committer | Aki Niemi <aki.niemi@nokia.com> | 2010-10-19 15:06:35 +0300 |
commit | 255782f8c2ff64991b362fb0e0554bd2adb7069e (patch) | |
tree | 86d891e0259255cc78f6344da69bbb33ad5a7b0c /drivers/isimodem/gprs-context.c | |
parent | fd74feac0d7c5bbba4653b0b5c43c458c6874971 (diff) | |
download | ofono-255782f8c2ff64991b362fb0e0554bd2adb7069e.tar.bz2 |
isimodem: Fix request cleanup code
Adds a check for when the driver is being removed, in which case no
new ISI requests should be generated.
Diffstat (limited to 'drivers/isimodem/gprs-context.c')
-rw-r--r-- | drivers/isimodem/gprs-context.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/isimodem/gprs-context.c b/drivers/isimodem/gprs-context.c index 31f882c6..47e858aa 100644 --- a/drivers/isimodem/gprs-context.c +++ b/drivers/isimodem/gprs-context.c @@ -515,7 +515,7 @@ static void isi_gprs_activate_primary(struct ofono_gprs_context *gc, struct context_data *cd = g_try_new0(struct context_data, 1); struct context_data *old = NULL; - if (!cd) + if (!gcd || !cd) return; cd->cid = ctx->cid; @@ -599,6 +599,9 @@ static void isi_gprs_deactivate_primary(struct ofono_gprs_context *gc, 0x00, /* GPDS context ID, added later */ }; + if (!gcd) + return; + cd = find_context_by_cid(gcd->contexts, cid); if (!cd) { DBG("unknown context: %u", cid); |