Hi Denis,

> > When is blocked, gprs/network atom is removed, it will remove the SIM
> > SPN watch which is added when it is created.
> > If at that time, SIM atom has been removed ofonod will crash due to
> > "sim->spn_watches" is NULL.
> >
> 
> This description makes no sense.  The SIM atom is never removed due to a
> blocked PIN, so can you please provide a more clear description of the issue?
> 
> > There is the same issue about network registration status watch.
> > ---
> >   src/watch.c |    3 +++
> >   1 file changed, 3 insertions(+)
> >
> > diff --git a/src/watch.c b/src/watch.c index dfb01fb..906c559 100644
> > --- a/src/watch.c
> > +++ b/src/watch.c
> > @@ -53,6 +53,9 @@ gboolean __ofono_watchlist_remove_item(struct
> ofono_watchlist *watchlist,
> >     GSList *p;
> >     GSList *c;
> >
> > +   if (watchlist == NULL)
> > +           return;
> > +
> 
> This fix is wrong, you're likely just covering up the symptom, not the cause.
> oFono operates on the principle of crash-early, so that bugs are easier to 
> detect
> and find.
> 
> What is the real reason why the watchlist is NULL at the point in time this
> function is being called?

Yes, you are right. The correct comment should be "If at that time, "spn_watch" 
has been removed ofonod will crash due to
"sim->spn_watches" is NULL."

"spn_watch" is removed at "sim_free_main_state" function when SIM PIN is 
blocked. This is done before gprs/network atom is removed.

About network registration status watch, the original comment is true.

Regards,
Caiwen
_______________________________________________
ofono mailing list
[email protected]
https://lists.ofono.org/mailman/listinfo/ofono

Reply via email to