Open Source Telephony
 help / color / mirror / Atom feed
* [PATCH 1/2] network.c: notify_status_watches: check for NULL
@ 2017-09-11  0:25 Alexander Couzens
  2017-09-11  0:25 ` [PATCH 2/2] qmimodem/network-registration: register callbacks after ofono_netreg_register() Alexander Couzens
  2017-09-11 15:39 ` [PATCH 1/2] network.c: notify_status_watches: check for NULL Denis Kenzior
  0 siblings, 2 replies; 4+ messages in thread
From: Alexander Couzens @ 2017-09-11  0:25 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 644 bytes --]

In rare cases when ofono_netreg_status_notify() is called before
ofono_netreg_register() netreg->status_watches is NULL.
---
 src/network.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/network.c b/src/network.c
index a3d41a74d555..6e69b078495f 100644
--- a/src/network.c
+++ b/src/network.c
@@ -1186,6 +1186,9 @@ static void notify_status_watches(struct ofono_netreg *netreg)
 	const char *mcc = NULL;
 	const char *mnc = NULL;
 
+	if (netreg->status_watches == NULL)
+		return;
+
 	if (netreg->current_operator) {
 		mcc = netreg->current_operator->mcc;
 		mnc = netreg->current_operator->mnc;
-- 
2.14.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-09-11 15:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-11  0:25 [PATCH 1/2] network.c: notify_status_watches: check for NULL Alexander Couzens
2017-09-11  0:25 ` [PATCH 2/2] qmimodem/network-registration: register callbacks after ofono_netreg_register() Alexander Couzens
2017-09-11 15:41   ` Denis Kenzior
2017-09-11 15:39 ` [PATCH 1/2] network.c: notify_status_watches: check for NULL Denis Kenzior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox