[PATCH 1/1] Revert "cbs: Fix possible NULL dereference"

Denis Grigorev <[email protected]>
Newsgroups dev.linux.lists.ofono
Message-ID <[email protected]>
At the time cbs_unregister() is called, cbs->netreg has already been
cleared in netreg_watch(), so __ofono_modem_remove_atom_watch() is
not called, resulting in a use-after-free later.

This reverts commit 5b528ee0fa699f598995772060e28653897e748f.
---
 src/cbs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/cbs.c b/src/cbs.c
index 246157b1..760fd860 100644
--- a/src/cbs.c
+++ b/src/cbs.c
@@ -593,7 +593,7 @@ static void cbs_unregister(struct ofono_atom *atom)
 		cbs->settings = NULL;
 	}
 
-	if (cbs->netreg_watch && cbs->netreg) {
+	if (cbs->netreg_watch) {
 		if (cbs->location_watch) {
 			__ofono_netreg_remove_status_watch(cbs->netreg,
 							cbs->location_watch);
-- 
2.17.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.