Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1094688ybi; Fri, 14 Jun 2019 08:32:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqwewNB/Z0Aa6yX40JoFOjM7HqFy7MJJ8g+KoTmDgKVXCInsCbs1F+xr+K5m3mI8cVUJXqzS X-Received: by 2002:a17:90a:d587:: with SMTP id v7mr12118517pju.28.1560526322447; Fri, 14 Jun 2019 08:32:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560526322; cv=none; d=google.com; s=arc-20160816; b=BuoW1u9OzDALbW5Fd5OUooV5/qV9z5fe3n+rQNplEH/5ssdqRCPp4K41mC1bjYhaqN GHBWoJ32toBptY2uL1MOE83gUWjjX0Mql15O+kEfni58NYTcQLwnh7M1tCFCX1dILVHs z9AkdYBjc4MG8EfmaVa7jnJVl1ILSlcb10SkfpIVdei7z+wDNRDcr4OffscX2m1s6kGq fcHrJgEW79XPMlNR37Bhc/f48M4QFNCjBZDcUaqa/8v0yheNVdD0WpxG8pIHt1MCmhdH 1BJf6NMBgBsGijq68NslTu4V4YByzufM+CPZTpvn2fvOaQSiuL4z9/ldA6TUI5cI4AbR yQ7A== 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 :message-id:date:subject:cc:to:from; bh=7yN5MEJ8hw4t6jWFlyXuLKiESHUo9CYGL8dTf9b0wmk=; b=XrXk/I9Xx4lY1pGFY/0Hn1CYcMms1WKtdkm7zxLsWDCcVAidhf6o/s3NmD0GdDJ4Sr D1NQqvI0QwFJh8TJKAQk3X3OWvA+xtSO1v5vb8DbphMQMZtuG5WoK6xSemPtEUa3tdOs Sag57l5qaXDAqoUcaNTX5fqyaxh31xSVxgmVvJ66t63NHpv6H5olfEDB8WdFFQrYdBIo 2mQImFxFzzDxzSIP6zkVNQ00hpuItgc//4K/T4NA8XJHqb1L1z1T3TjKhieAuKruUK7i bMNlQlnsU/S0Ue9PLqlbIxim2ELqNguJ4MnSofQGCrlIPv9iwSyBHZBerm9AhhiM2sjL nYqw== 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 m4si2521543pjk.66.2019.06.14.08.31.33; Fri, 14 Jun 2019 08:32:02 -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 S1725991AbfFNPbb (ORCPT + 99 others); Fri, 14 Jun 2019 11:31:31 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:46375 "EHLO relay1-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725780AbfFNPbb (ORCPT ); Fri, 14 Jun 2019 11:31:31 -0400 X-Originating-IP: 83.155.44.161 Received: from classic.redhat.com (mon69-7-83-155-44-161.fbx.proxad.net [83.155.44.161]) (Authenticated sender: hadess@hadess.net) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id BAED7240009; Fri, 14 Jun 2019 15:31:26 +0000 (UTC) From: Bastien Nocera To: linux-bluetooth@vger.kernel.org Cc: Benjamin Tissoires Subject: [PATCH] input/hog: Remove HID device after HoG device disconnects Date: Fri, 14 Jun 2019 17:31:25 +0200 Message-Id: <20190614153125.2605-1-hadess@hadess.net> X-Mailer: git-send-email 2.21.0 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 From: Benjamin Tissoires When the Bluetooth LE device disconnects, make sure to also destroy the uHID device so that we don't have a lingering HID device accessible from user-space. This also fixes the input subsystem never seeing the device reattaching, causing settings that should be applied on connection not to be applied. https://bugzilla.kernel.org/show_bug.cgi?id=202909 Tested-by: Bastien Nocera --- profiles/input/hog.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/profiles/input/hog.c b/profiles/input/hog.c index 23c9c1529..83c017dcb 100644 --- a/profiles/input/hog.c +++ b/profiles/input/hog.c @@ -199,6 +199,8 @@ static int hog_disconnect(struct btd_service *service) struct hog_device *dev = btd_service_get_user_data(service); bt_hog_detach(dev->hog); + bt_hog_unref(dev->hog); + dev->hog = NULL; btd_service_disconnecting_complete(service, 0); -- 2.21.0