From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH 2/2] Check modem device open failure
Date: Tue, 26 Apr 2011 14:53:59 -0500 [thread overview]
Message-ID: <4DB722D7.7020206@gmail.com> (raw)
In-Reply-To: <1303808863-831-2-git-send-email-martin.xu@intel.com>
[-- Attachment #1: Type: text/plain, Size: 1599 bytes --]
Hi Martin,
On 04/26/2011 04:07 AM, martin.xu(a)intel.com wrote:
> From: Martin Xu <martin.xu@intel.com>
>
> disable gprs function if open modem device file failed, Otherwise, it
> will cause ofonod crash, due to gatchat is NULL.
> ---
> plugins/huawei.c | 10 ++++++----
> 1 files changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/plugins/huawei.c b/plugins/huawei.c
> index 4051a93..1f69a8c 100644
> --- a/plugins/huawei.c
> +++ b/plugins/huawei.c
> @@ -475,9 +475,10 @@ static void huawei_disconnect(gpointer user_data)
> data->modem = NULL;
>
> data->modem = open_device(modem, "Modem", "Modem: ");
> - if (data->modem == NULL)
> + if (data->modem == NULL) {
> + ofono_error("open device failed!");
> return;
> -
> + }
> g_at_chat_set_disconnect_function(data->modem,
> huawei_disconnect, modem);
>
I dropped this chunk from the patch, I didn't think it was adding
anything useful.
> @@ -681,8 +682,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);
>
This chunk has been applied with a slightly reworded commit message.
Thanks for that.
Regards,
-Denis
prev parent reply other threads:[~2011-04-26 19:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-26 9:07 [PATCH 2/2] Check modem device open failure martin.xu
2011-04-26 19:53 ` Denis Kenzior [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4DB722D7.7020206@gmail.com \
--to=denkenz@gmail.com \
--cc=ofono@ofono.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox