Skip to contentSkip to conversation

Don't pass down NULL path to dbus if no modem.

PATCH In review Zhu Yanhai 2 participants 2 messages Jan 11, 2010 Bluetooth drivers

lore
Share & tools
lore

Zhu Yanhai

author
#0 lore raw

PATCH 1/1 Don't pass down NULL path to dbus if no modem.

We shouldn't pass down NULL object path to dbus if there's no modem, which is a common case on many netbooks.

---
 audio/telephony-ofono.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
audio/telephony-ofono.c +5 -0
index 2778cfc..2970e43 100644
@@ -579,6 +579,11 @@ static void list_modem_reply(DBusPendingCall *call, void *user_data)
 						modem_obj_path);
 		dbus_message_iter_next(&sub);
 	}
+	if (modem_obj_path == NULL)
+	{
+		debug("no modem found.\n");	
+		goto done;
+	}
 
 	ret = get_registration_and_signal_status();
 	if (ret < 0)
Signature · 1 line
1.6.2.2
#1 lore raw

Hi,

audio/telephony-ofono.c static void list_modem_reply(DBusPendingCall *call, void *user_data) · line 586

Quoted 12 lines · Zhu Yanhai

index 2778cfc..2970e43 100644

audio/telephony-ofono.c +5 -0
@@ -579,6 +579,11 @@ static void list_modem_reply(DBusPendingCall *call, void *user_data)
 						modem_obj_path);
 		dbus_message_iter_next(&sub);
 	}
+	if (modem_obj_path == NULL)
+	{
+		debug("no modem found.\n");	
+		goto done;
+	}

Functionally the patch seems fine, but could you fix a few coding style issues please:

* empty line before the if-statement
* opening { on the same line as the if statement
* no \n in the debug statement (that gets added automatically).
* Remove whitespace from the end of the debug line (right now you have a tab after the semicolon)

Johan