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/ssn.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/ssn.c')
-rw-r--r-- | drivers/isimodem/ssn.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/isimodem/ssn.c b/drivers/isimodem/ssn.c index e69ea16d..797ba9d2 100644 --- a/drivers/isimodem/ssn.c +++ b/drivers/isimodem/ssn.c @@ -67,10 +67,12 @@ static void isi_ssn_remove(struct ofono_ssn *ssn) { struct ssn_data *data = ofono_ssn_get_data(ssn); - if (data) { - g_isi_client_destroy(data->client); - g_free(data); - } + if (!data) + return; + + ofono_ssn_set_data(ssn, NULL); + g_isi_client_destroy(data->client); + g_free(data); } static struct ofono_ssn_driver driver = { |