diff mbox series

[2/4] cbs: Fix possible NULL dereference

Message ID 20240716101136.44583-3-m.rudik@omp.ru (mailing list archive)
State Accepted
Commit 5b528ee0fa699f598995772060e28653897e748f
Headers show
Series Fix issues found with static analyzer | expand

Commit Message

Max Rudik July 16, 2024, 10:11 a.m. UTC
---
 src/cbs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/src/cbs.c b/src/cbs.c
index 760fd860..246157b1 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) {
+	if (cbs->netreg_watch && cbs->netreg) {
 		if (cbs->location_watch) {
 			__ofono_netreg_remove_status_watch(cbs->netreg,
 							cbs->location_watch);