All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] src/modem.c/call_watches null pointer check
@ 2018-10-23  7:50 Giacinto Cifelli
  2018-10-23  7:50 ` [PATCH] src/modem: connection timeout to 60 seconds Giacinto Cifelli
  2018-10-23 14:30 ` [PATCH] src/modem.c/call_watches null pointer check Denis Kenzior
  0 siblings, 2 replies; 18+ messages in thread
From: Giacinto Cifelli @ 2018-10-23  7:50 UTC (permalink / raw)
  To: ofono

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

check the pointer modem->atom_watches, that can be null when the
function is called during the disable/remove of the device,
for example when it is unplugged or switched off.
---
 src/modem.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/modem.c b/src/modem.c
index 9e254482..124a5192 100644
--- a/src/modem.c
+++ b/src/modem.c
@@ -255,11 +255,16 @@ static void call_watches(struct ofono_atom *atom,
 				enum ofono_atom_watch_condition cond)
 {
 	struct ofono_modem *modem = atom->modem;
-	GSList *atom_watches = modem->atom_watches->items;
+	GSList *atom_watches;
 	GSList *l;
 	struct atom_watch *watch;
 	ofono_atom_watch_func notify;
 
+	if (!modem->atom_watches)
+		return;
+
+	atom_watches = modem->atom_watches->items;
+
 	for (l = atom_watches; l; l = l->next) {
 		watch = l->data;
 
-- 
2.17.1


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

end of thread, other threads:[~2018-10-23 18:34 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-23  7:50 [PATCH] src/modem.c/call_watches null pointer check Giacinto Cifelli
2018-10-23  7:50 ` [PATCH] src/modem: connection timeout to 60 seconds Giacinto Cifelli
2018-10-23  8:34   ` Jonas Bonn
2018-10-23  8:40     ` Giacinto Cifelli
2018-10-23  8:53       ` Jonas Bonn
2018-10-23  9:26         ` Giacinto Cifelli
2018-10-23 10:45           ` Jonas Bonn
2018-10-23 15:08       ` Denis Kenzior
2018-10-23 18:34         ` Giacinto Cifelli
2018-10-23 10:35   ` Slava Monich
2018-10-23 14:30 ` [PATCH] src/modem.c/call_watches null pointer check Denis Kenzior
2018-10-23 14:44   ` Giacinto Cifelli
2018-10-23 14:47     ` Denis Kenzior
2018-10-23 16:39       ` Giacinto Cifelli
2018-10-23 16:50         ` Denis Kenzior
2018-10-23 17:30           ` Giacinto Cifelli
2018-10-23 17:40             ` Denis Kenzior
2018-10-23 17:51               ` Giacinto Cifelli

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.