Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp8939532ybi; Fri, 7 Jun 2019 00:14:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqzYiD/P2/53YOMNo/vbvP3bjW1+RoCu6MwLTtOFCPzY7+WRj2NCGxLm+FEn4p56tRkGgfWy X-Received: by 2002:a17:902:824:: with SMTP id 33mr55747808plk.29.1559891696923; Fri, 07 Jun 2019 00:14:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559891696; cv=none; d=google.com; s=arc-20160816; b=Z41YtnnioMqX4enJ4RLCmoYGCrzc/U5u5OJY6/xNAThOfynKxUm0iyQWD61PuZu9gF rXrUd7RuzlvpJowisIU6JaAo4o8NrOAdjgdDNbRUsnL0lXeeAzbB3wKKAJ3g724L65Jc TqCelUU1WRg+APzY3a7Ac6+hq3qAPoUXN6jiuI3naykGSx6/pYWo9lQqdgabguQhKHDL 64w272/nI3DHMuMCk9Ko2f79WQecr/ZZNjzasReTaNbLmT1wRWsK5uvL0/ONOrEMV7hP NT2L3xhZERhpPEiZM5k+qG5ZW6C019BtjXgFs0sK2sHRCYULmfJm4M9pVP6h5q2hHEHr lVgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from; bh=DRd2z2UW29ckbQuFGVFsSs7ZR9iSmrAn0Kuw5YvFQOk=; b=MIkPhoFTPDbymAD/OUBBcgaK1UfK1G6pxyg8m2G8FNEvp/Jzh8apCJfVAFOSNY2qe2 b1U8PreZtrmQy3VwIxx8j8uyBsHj05zyJLi48E0KSl0eMM25DJ78B9LeYxx0KIs1FQek mzESpkgmBBiMIGEA8i0W9CO2z87lKka0u9vxcvVKBWFmhHW6jDZ5JvzvgIKe9RW7uUzE hwRQ9RXyk0rpLteHkzuARfkachyuRUNMgu0u4WDX31j78j52NCpntKcuUlysvuFU1fj0 GgaTxqFAwhyLNN+dFmmX29zmt0oQxfrvQxdpuQy6CpHovFeB6Xu56v8nlMnCBjEIs6Nr twbg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a6si1070210pgq.24.2019.06.07.00.14.27; Fri, 07 Jun 2019 00:14:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727061AbfFGGyT (ORCPT + 99 others); Fri, 7 Jun 2019 02:54:19 -0400 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:48281 "EHLO relay6-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726825AbfFGGyT (ORCPT ); Fri, 7 Jun 2019 02:54:19 -0400 X-Originating-IP: 83.155.44.161 Received: from localhost.localdomain (mon69-7-83-155-44-161.fbx.proxad.net [83.155.44.161]) (Authenticated sender: hadess@hadess.net) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 668B5C0013 for ; Fri, 7 Jun 2019 06:54:14 +0000 (UTC) From: Bastien Nocera 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 Message-Id: <20190607065411.28502-2-hadess@hadess.net> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190607065411.28502-1-hadess@hadess.net> References: <20190607065411.28502-1-hadess@hadess.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org 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