Linux bluetooth development
 help / color / mirror / Atom feed
From: Johan Hedberg <johan.hedberg@nokia.com>
To: bluez-devel@lists.sourceforge.net
Subject: Re: [Bluez-devel] hcid patch (remote name and connections)
Date: Wed, 12 Oct 2005 22:38:11 +0300	[thread overview]
Message-ID: <20051012193811.GA5505@localhost.localdomain> (raw)
In-Reply-To: <1129070919.6487.4.camel@localhost.localdomain>

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

Hi,

I missed one place in the code where hci_dbus_data should be allocated
(thanks to Claudio for noticing). Here's a patch to fix it.

Johan

[-- Attachment #2: segfault.patch --]
[-- Type: text/plain, Size: 820 bytes --]

Index: hcid/dbus.c
===================================================================
RCS file: /cvsroot/bluez/utils/hcid/dbus.c,v
retrieving revision 1.21
diff -u -r1.21 dbus.c
--- hcid/dbus.c	11 Oct 2005 22:45:38 -0000	1.21
+++ hcid/dbus.c	12 Oct 2005 19:13:14 -0000
@@ -774,7 +774,13 @@
 
 		syslog(LOG_INFO, "registering dft path:%s - id:%d", path, DEFAULT_DEVICE_PATH_ID);
 
-		if (!dbus_connection_register_object_path(conn, path, &obj_vtable, (void *) DEFAULT_DEVICE_PATH_ID)) { 
+		data = malloc(sizeof(struct hci_dbus_data));
+		if (data == NULL)
+			return -1;
+
+		data->id = DEFAULT_DEVICE_PATH_ID;
+
+		if (!dbus_connection_register_object_path(conn, path, &obj_vtable, data)) { 
 			syslog(LOG_ERR,"DBUS failed to register %s object", path);
 			/* ignore, the default path was already registered */
 		}

  reply	other threads:[~2005-10-12 19:38 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-11 14:26 [Bluez-devel] hcid patch (remote name and connections) Claudio Takahasi
2005-10-11 14:49 ` [Bluez-devel] " Claudio Takahasi
2005-10-11 19:47   ` Steven Singer
2005-10-11 20:07     ` Claudio Takahasi
2005-10-11 21:14       ` Steven Singer
2005-10-11 22:37         ` Marcel Holtmann
2005-10-11 18:01 ` [Bluez-devel] " Marcel Holtmann
2005-10-11 19:28   ` Johan Hedberg
2005-10-11 19:45     ` Steven Singer
2005-10-11 19:55       ` Johan Hedberg
2005-10-11 22:48         ` Marcel Holtmann
2005-10-12 19:38           ` Johan Hedberg [this message]
2005-10-12 21:14             ` Claudio Takahasi
2005-10-13  9:38               ` 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=20051012193811.GA5505@localhost.localdomain \
    --to=johan.hedberg@nokia.com \
    --cc=bluez-devel@lists.sourceforge.net \
    /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