From: Bastien Nocera <hadess@hadess.net>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH 2/2] sixaxis: Throw an error when cable setup fails
Date: Fri, 7 Jun 2019 08:54:11 +0200 [thread overview]
Message-ID: <20190607065411.28502-2-hadess@hadess.net> (raw)
In-Reply-To: <20190607065411.28502-1-hadess@hadess.net>
If btd_request_authorization_cable_configured() fails, throw an error
and free resources.
---
plugins/sixaxis.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/plugins/sixaxis.c b/plugins/sixaxis.c
index 12638829b..939fed759 100644
--- a/plugins/sixaxis.c
+++ b/plugins/sixaxis.c
@@ -384,6 +384,12 @@ static bool setup_device(int fd, const char *sysfs_path,
adapter_bdaddr, &device_bdaddr,
HID_UUID, agent_auth_cb, closure);
+ if (closure->auth_id == 0) {
+ error("sixaxis: could not request cable authorization");
+ auth_closure_destroy(closure, true);
+ return false;
+ }
+
g_hash_table_insert(pending_auths, closure->sysfs_path, closure);
return true;
--
2.21.0
next prev parent reply other threads:[~2019-06-07 6:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-07 6:54 [PATCH 1/2] sixaxis: Fix another problem with already setup devices Bastien Nocera
2019-06-07 6:54 ` Bastien Nocera [this message]
2019-06-13 9:54 ` Szymon Janc
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=20190607065411.28502-2-hadess@hadess.net \
--to=hadess@hadess.net \
--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).