linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ 6/6] audio/a2dp: Fix always setting -EAGAIN for all errors
Date: Thu, 28 Jul 2016 17:27:50 +0300	[thread overview]
Message-ID: <1469716070-16506-7-git-send-email-luiz.dentz@gmail.com> (raw)
In-Reply-To: <1469716070-16506-1-git-send-email-luiz.dentz@gmail.com>

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

avdtp_error_posix_errno always return the posix errno not the negative
one which is then assigned to perror negative and then again as negative
in the switch statement making it assume the original value which is the
positive errno which don't match with the expected values which are
negative causing -EAGAIN to always be returned.
---
 profiles/audio/a2dp.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c
index b391fc2..db0736d 100644
--- a/profiles/audio/a2dp.c
+++ b/profiles/audio/a2dp.c
@@ -235,11 +235,11 @@ static int error_to_errno(struct avdtp_error *err)
 	if (avdtp_error_category(err) != AVDTP_ERRNO)
 		return -EIO;
 
-	perr = -avdtp_error_posix_errno(err);
-	switch (-perr) {
-	case -EHOSTDOWN:
-	case -ECONNABORTED:
-		return perr;
+	perr = avdtp_error_posix_errno(err);
+	switch (perr) {
+	case EHOSTDOWN:
+	case ECONNABORTED:
+		return -perr;
 	default:
 		/*
 		 * An unexpect error has occurred setup may be attempted again.
-- 
2.7.4


  parent reply	other threads:[~2016-07-28 14:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-28 14:27 [PATCH BlueZ 0/6] plugins/policy: Fixes Luiz Augusto von Dentz
2016-07-28 14:27 ` [PATCH BlueZ 1/6] lib/uuid: Fix using unitialized values Luiz Augusto von Dentz
2016-07-28 14:27 ` [PATCH BlueZ 2/6] plugins/policy: Revert patch 96db78604252eeb17614b9982ced95fd66c6c6fc Luiz Augusto von Dentz
2016-07-28 14:27 ` [PATCH BlueZ 3/6] plugins/policy: Set list separator Luiz Augusto von Dentz
2016-07-28 14:27 ` [PATCH BlueZ 4/6] main.conf: Remove spaces in reconnect list parameters Luiz Augusto von Dentz
2016-07-28 14:27 ` [PATCH BlueZ 5/6] plugins/policy: Disable other connect policies while reconnect is active Luiz Augusto von Dentz
2016-07-28 14:27 ` Luiz Augusto von Dentz [this message]
2016-08-01 11:57 ` [PATCH BlueZ 0/6] plugins/policy: Fixes Luiz Augusto von Dentz

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=1469716070-16506-7-git-send-email-luiz.dentz@gmail.com \
    --to=luiz.dentz@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;
as well as URLs for NNTP newsgroup(s).