diff options
author | Martin Xu <martin.xu@intel.com> | 2011-04-26 17:07:43 +0800 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2011-04-26 14:51:57 -0500 |
commit | d38fa75518115e713b57c8b28fee496b6aff2123 (patch) | |
tree | 5a331ac3d60ad5c2dfb9f11f9ca5f4783d18575f /plugins | |
parent | 0dc3d69c54b0b2b0b458e95a2e648ea999344dba (diff) |
huawei: Check that the modem device is open
Don't create the gprs atom if the modem device was not opened
successfully. Otherwise ofonod will crash.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/huawei.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/huawei.c b/plugins/huawei.c index 4051a934..b3844e97 100644 --- a/plugins/huawei.c +++ b/plugins/huawei.c @@ -681,8 +681,9 @@ static void huawei_post_online(struct ofono_modem *modem) ofono_ussd_create(modem, OFONO_VENDOR_QUALCOMM_MSM, "atmodem", data->pcui); - if (data->sim_state == HUAWEI_SIM_STATE_VALID || - data->sim_state == HUAWEI_SIM_STATE_INVALID_CS) { + if ((data->sim_state == HUAWEI_SIM_STATE_VALID || + data->sim_state == HUAWEI_SIM_STATE_INVALID_CS) && + data->modem != NULL) { data->gprs = ofono_gprs_create(modem, OFONO_VENDOR_HUAWEI, "atmodem", data->pcui); |