diff options
author | Bastien Nocera <hadess@hadess.net> | 2019-06-07 08:54:11 +0200 |
---|---|---|
committer | Szymon Janc <szymon.janc@codecoup.pl> | 2019-06-13 11:24:55 +0200 |
commit | ee70e5e070505e7caef66e9446ac586c378bde0f (patch) | |
tree | 24dcf0d7abc9aed90cf9aa3dd9905cd51929e8c8 | |
parent | 59b934ab8deac7b76b7b397b6424f1806b42b753 (diff) | |
download | bluez-ee70e5e070505e7caef66e9446ac586c378bde0f.tar.gz |
sixaxis: Throw an error when cable setup fails
If btd_request_authorization_cable_configured() fails, throw an error
and free resources.
-rw-r--r-- | plugins/sixaxis.c | 6 |
1 files changed, 6 insertions, 0 deletions
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; |