public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: "Liu, Raymond" <raymond.liu@intel.com>
Cc: BlueZ development <linux-bluetooth@vger.kernel.org>
Subject: Re: [patch] obexd: if path == NULL, don't call dbus_connection_get_object_path_data
Date: Wed, 24 Dec 2008 04:41:36 +0100	[thread overview]
Message-ID: <1230090097.4954.27.camel@californication> (raw)
In-Reply-To: <0463F45F3606F4428ED35AC8C709F92E046C0469@pdsmsx502.ccr.corp.intel.com>

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



  reply	other threads:[~2008-12-24  3:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-23  1:33 [patch] fix the bug of obex_object_resume(), obex_server() in openobex Zhao Forrest
2008-12-24  1:23 ` Johan Hedberg
2008-12-24  3:13   ` [patch] obexd: if path == NULL, don't call dbus_connection_get_object_path_data Liu, Raymond
2008-12-24  3:41     ` Marcel Holtmann [this message]
2008-12-24  5:05       ` Liu, Raymond
2008-12-24  6:17         ` Marcel Holtmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1230090097.4954.27.camel@californication \
    --to=marcel@holtmann.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=raymond.liu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox