sixaxis: Throw an error when cable setup fails

If btd_request_authorization_cable_configured() fails, throw an error
and free resources.
This commit is contained in:
Bastien Nocera 2019-06-07 08:54:11 +02:00 committed by Szymon Janc
parent 59b934ab8d
commit ee70e5e070

View File

@ -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;