Linux bluetooth development
 help / color / mirror / Atom feed
From: Rafal Michalski <michalski.raf@gmail.com>
To: linux-bluetooth@vger.kernel.org
Cc: Rafal Michalski <michalski.raf@gmail.com>
Subject: [PATCH] Fix crash after simultaneous authentication requests
Date: Thu, 25 Nov 2010 11:06:55 +0100	[thread overview]
Message-ID: <1290679615-26273-1-git-send-email-michalski.raf@gmail.com> (raw)

Previously simultaneous authentication requests to the same device caused
bluetoothd crash. Now if ongoing authentication occurs error is returned,
preventing from simultaneous requests to the same device.
---
 src/device.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/device.c b/src/device.c
index 7c421e3..4427cd4 100644
--- a/src/device.c
+++ b/src/device.c
@@ -2178,6 +2178,11 @@ int device_request_authentication(struct btd_device *device, auth_type_t type,
 	struct agent *agent;
 	int err;
 
+	if (device->authr) {
+		error("%s: authentication already requested", device->path);
+		return -EALREADY;
+	}
+
 	DBG("%s: requesting agent authentication", device->path);
 
 	agent = device_get_agent(device);
-- 
1.6.3.3


             reply	other threads:[~2010-11-25 10:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-25 10:06 Rafal Michalski [this message]
2010-11-25 20:11 ` [PATCH] Fix crash after simultaneous authentication requests Johan Hedberg

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=1290679615-26273-1-git-send-email-michalski.raf@gmail.com \
    --to=michalski.raf@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