From 255782f8c2ff64991b362fb0e0554bd2adb7069e Mon Sep 17 00:00:00 2001 From: Aki Niemi Date: Tue, 19 Oct 2010 11:28:06 +0300 Subject: 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. --- drivers/isimodem/ssn.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'drivers/isimodem/ssn.c') 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 = { -- cgit v1.2.3