Re: [patch] obexd: if path == NULL, don't call dbus_connection_get_object_path_data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Raymond,

> 	Just a minor fix for g_dbus_unregister_interface to avoid calling dbus_connection_get_object_path_data when path is NULL.

@@ -494,7 +494,7 @@ gboolean g_dbus_unregister_interface(DBusConnection *connection,
        struct generic_data *data = NULL;
        struct interface_data *iface;
 
-       if (dbus_connection_get_object_path_data(connection, path,
+       if (!path || dbus_connection_get_object_path_data(connection, path,
                                                (void *) &data) == FALSE)
                return FALSE;

So doing some like this would be better:

	if (!path)
		return FALSE;

	if (dbus_connection ...)
		return FALSE;

You should really start thinking for the error => return paradigm all
the time. This makes the code a lot simpler to read.

Regards

Marcel


--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux