All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix: Add check for register_auto method
@ 2009-11-25  5:43 Zhenhua Zhang
  2009-11-25  2:44 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: Zhenhua Zhang @ 2009-11-25  5:43 UTC (permalink / raw)
  To: ofono

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

Add check for register_auto method to avoid crash. HFP backend
does not provide implementation for register_auto.
---
 src/network.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/network.c b/src/network.c
index 8f99490..24cb911 100644
--- a/src/network.c
+++ b/src/network.c
@@ -1305,8 +1305,11 @@ static void init_registration_status(const struct ofono_error *error,
 	if (netreg->mode == NETWORK_REGISTRATION_MODE_AUTO &&
 		(status == NETWORK_REGISTRATION_STATUS_NOT_REGISTERED ||
 			status == NETWORK_REGISTRATION_STATUS_DENIED ||
-			status == NETWORK_REGISTRATION_STATUS_UNKNOWN))
-		netreg->driver->register_auto(netreg, init_register, netreg);
+			status == NETWORK_REGISTRATION_STATUS_UNKNOWN)) {
+		if (netreg->driver->register_auto)
+			netreg->driver->register_auto(netreg, init_register,
+					netreg);
+	}
 }
 
 void ofono_netreg_strength_notify(struct ofono_netreg *netreg, int strength)
-- 
1.6.2.5


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

end of thread, other threads:[~2009-11-25  5:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-25  5:43 [PATCH] Fix: Add check for register_auto method Zhenhua Zhang
2009-11-25  2:44 ` Denis Kenzior

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.