Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp2326608pxv; Sat, 24 Jul 2021 12:24:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwYmrsoyEsdotQZrN+7h9usiahlIVvXIusVlWfsjz5Ur0PXB4Zo2B3Y3a9la3rysEVDaf09 X-Received: by 2002:a6b:3e8b:: with SMTP id l133mr8488553ioa.137.1627154647261; Sat, 24 Jul 2021 12:24:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627154647; cv=none; d=google.com; s=arc-20160816; b=OPqPeayoWX9Hvb3nza6KburgWdHcY/j1ihg4/0IXlW6E7l68xPPM/rvx3CSWTR/TIu CrSyUbrN7yPZfb52Pzr8lU3BflPNt/HWziWUTiM2tmYCpFq+RxZu6RLU2iKWIvlJTzW0 43O30zdM71sJhXiuBo9M0qrA3whnZwG8r6lDVpJk5qe+/CRnhcHUoigwYZ+HSd02aE1d eI2WUNodVoT1C49OHlUgUwvpf4lzQXoK+KbFzF/nTNsQEuocg1uBJvcAv3tEmPYuIN1o vmXrMl7uzWtD1cPmSVSJmiDRNW0epATxh+6F6i4EHZ+6Ee7P2X9NZaJnhQ5CZTE77BeN U3Eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=38DFumcmMoU73KXqfkWhA9tfukcr6eOACi13gUfIcko=; b=jPXoiScAmW3IpSe2nhb1B7xLyPpD+UzY8Eo3AcLztmLzTRstDTsVd7GczQfrs99f51 EPHxBpEyinF+cYRwD8yaha3nMMUqRqurz4Gzc88B4fQD4wQis+KvZkfWAMcdWyzjABK6 5O+sx7Gh4+knILgwc+cC6sgciV5i+XyFjZwcCdcoPwktk3FwdE9X/2DNcPBvewUvpic5 jatQrr1YYClKbyxlLJmcStaFwnLKNCTRnrBI5I9K0YJv1D6ooh5D9tzeP/92ad5A5NC4 WbvT6MI7DQ6D4gG166KttVXd32F+KhoENFH+ZPMa8N/2siKNJktcKnBPr3EowbAo7IvV PiAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JPMJlAcr; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w12si38274729ilv.127.2021.07.24.12.23.36; Sat, 24 Jul 2021 12:24:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JPMJlAcr; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229476AbhGXSlG (ORCPT + 99 others); Sat, 24 Jul 2021 14:41:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229655AbhGXSlF (ORCPT ); Sat, 24 Jul 2021 14:41:05 -0400 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 314DFC061575; Sat, 24 Jul 2021 12:21:36 -0700 (PDT) Received: by mail-ej1-x633.google.com with SMTP id hb6so8858253ejc.8; Sat, 24 Jul 2021 12:21:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=38DFumcmMoU73KXqfkWhA9tfukcr6eOACi13gUfIcko=; b=JPMJlAcrsz5AdPywDwTbTf+WHkvgaHfrJNFxaYqPQKSUZP4ZSCynqXEu84keJkWGw6 HiJ52gtz9Vvhx/XOhiQR7GuIynffPbEjSrWQEPxtGKUsaHGnJ8UYmhbD/XWzqm+SXI29 JqkORwscqwffh3KZVOmJBf+3BgHuhhYSgf5ry75r1yjUOnH6zci/k0/szFU7En5NZp4e 7eQAo8sRVFbBBPq+azTU1HaMAgjh6iAlyqkb38sONkJJAoPaGUu1le76P6xwds5a87+C UySJ3J55QOmAVO/tenC4IgVDtrTlL8U/XkU0s0e71M0iepRRST8YTBUA2fJ0M4t4BlXH v2rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=38DFumcmMoU73KXqfkWhA9tfukcr6eOACi13gUfIcko=; b=s4pg7LeBPc0LPsJFhBfdqHY59oIl2RqKIxT+HEqmnfIlQYhTQUs/0XaSs125//sz1E LDWmNa9thA4SYvPesHZtjnL6HMB3aJC0Mg/NbHv9YkwwhqC5GOVbDTFf9eZ0XyQV9rWh n8Uqnkij4K+CeHSUcFIr7tEyCYp08di0K1aW1FkggnZnHnVyyqaeEKdfK4E+1ki3lbFz od7tgYY4UFHV35D4RyrI2fbcgNvBjAo2o1bQ5ZFe+EElX5nQ8Ip8pKhK3cUP6UL00SG2 apMg6onGvV3DnESAVeFMAiY/HNzoFQa4xMTn/og29lVLD3vb4nGPw4D3sUCLh8B9lYRH TcbQ== X-Gm-Message-State: AOAM533dYe6KPUzzc/oLOo5CP1zzBzjMmyskAu0mRmefz4N+jC2m6Y7N 4KJtfU1fHlk0kILbO36QylGxQe4lIakWPA== X-Received: by 2002:a17:906:aad9:: with SMTP id kt25mr10386374ejb.48.1627154494803; Sat, 24 Jul 2021 12:21:34 -0700 (PDT) Received: from pc ([196.235.233.206]) by smtp.gmail.com with ESMTPSA id ch27sm16872876edb.57.2021.07.24.12.21.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Jul 2021 12:21:34 -0700 (PDT) Date: Sat, 24 Jul 2021 20:21:31 +0100 From: Salah Triki To: Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz , gregkh@linuxfoundation.org Cc: linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] bluetooth: bfusb: update the reference count of udev Message-ID: <20210724192131.GA490422@pc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Use usb_get_dev() and usb_put_dev() in order to update the reference count of udev. Signed-off-by: Salah Triki --- drivers/bluetooth/bfusb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/bluetooth/bfusb.c b/drivers/bluetooth/bfusb.c index 5a321b4076aa..c9145c914451 100644 --- a/drivers/bluetooth/bfusb.c +++ b/drivers/bluetooth/bfusb.c @@ -623,7 +623,7 @@ static int bfusb_probe(struct usb_interface *intf, const struct usb_device_id *i if (!data) return -ENOMEM; - data->udev = udev; + data->udev = usb_get_dev(udev); data->bulk_in_ep = bulk_in_ep->desc.bEndpointAddress; data->bulk_out_ep = bulk_out_ep->desc.bEndpointAddress; data->bulk_pkt_size = le16_to_cpu(bulk_out_ep->desc.wMaxPacketSize); @@ -699,6 +699,8 @@ static void bfusb_disconnect(struct usb_interface *intf) usb_set_intfdata(intf, NULL); + usb_put_dev(interface_to_usbdev(intf)); + bfusb_close(hdev); hci_unregister_dev(hdev); -- 2.25.1