public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: "Erik Andrén" <erik.andren@gmail.com>
To: linux-bluetooth@vger.kernel.org
Cc: "Erik Andrén" <erik.andren@gmail.com>
Subject: [PATCH 1/2] Propagata hci_register_sysfs() error
Date: Sat,  7 Mar 2009 23:10:28 +0100	[thread overview]
Message-ID: <1236463829-19977-1-git-send-email-erik.andren@gmail.com> (raw)
In-Reply-To: <1>

Currently if the hci_register_sysfs() function fails, the error is not propagated. Make it so.

Signed-off-by: Erik Andrén <erik.andren@gmail.com>
---
 net/bluetooth/hci_core.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index cd06151..9c98f6e 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -842,7 +842,7 @@ EXPORT_SYMBOL(hci_free_dev);
 int hci_register_dev(struct hci_dev *hdev)
 {
 	struct list_head *head = &hci_dev_list, *p;
-	int i, id = 0;
+	int i, err, id = 0;
 
 	BT_DBG("%p name %s type %d owner %p", hdev, hdev->name, hdev->type, hdev->owner);
 
@@ -855,7 +855,8 @@ int hci_register_dev(struct hci_dev *hdev)
 	list_for_each(p, &hci_dev_list) {
 		if (list_entry(p, struct hci_dev, list)->id != id)
 			break;
-		head = p; id++;
+		head = p;
+		id++;
 	}
 
 	sprintf(hdev->name, "hci%d", id);
@@ -898,7 +899,9 @@ int hci_register_dev(struct hci_dev *hdev)
 
 	write_unlock_bh(&hci_dev_list_lock);
 
-	hci_register_sysfs(hdev);
+	err = hci_register_sysfs(hdev);
+	if (err < 0)
+		return err;
 
 	hci_notify(hdev, HCI_DEV_REG);
 
-- 
1.5.6.3


       reply	other threads:[~2009-03-07 22:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1>
2009-03-07 22:10 ` Erik Andrén [this message]
2009-03-07 22:10   ` [PATCH 2/2] Defer btaddconn and btdelconn workqueues until a device has actually connected Erik Andrén
2009-03-09 19:55 ` Checkpatch fixes against bluetooth-testing Erik Andrén
2009-03-09 19:55   ` [PATCH 1/3] Checkpatch.pl: Fixup hci_conn.c Erik Andrén
2009-03-09 19:55     ` [PATCH 2/3] Checkpatch.pl: Fixup hci_core.c Erik Andrén
2009-03-09 19:55       ` [PATCH 3/3] Checkpatch.pl: Fixup hci_event.c Erik Andrén

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=1236463829-19977-1-git-send-email-erik.andren@gmail.com \
    --to=erik.andren@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /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