Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp2376115pxv; Sat, 24 Jul 2021 14:22:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfN3cKox8UaakqsVO4YTzQvedmF23HgQeLp+wwJg8BuGyir3X35aRRbB3OfwDzdFMTpYcr X-Received: by 2002:a92:d251:: with SMTP id v17mr7493726ilg.283.1627161753347; Sat, 24 Jul 2021 14:22:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627161753; cv=none; d=google.com; s=arc-20160816; b=YmvppvSWc7lwnIROkymIiYDQwTcwDVNC6Jh2DCPl9T0knBzd3kkXpzzU8khaJ8K5D2 H6mmREmR6j/Awrh8yNUMUcMl+cu0eH42IwLcwn+fXDul1u27u0MGj5qZhf3xyheJtIll Pp5i4BMnLwnBuV5K51gkuvaghNRJ4eCoEXaqh6Dsxsb4FqrxxPeNQVkL/AMo9wLx2BZ7 RFiwox3a3Lw4OLbt4C0IQX7x5o7guqFYosZfNJp10mJBin6JhVdLckia7fHZV2R3gKuf oH13D8QRVUaSe66qqVDU8Am9eX/jQWWHgftjgYWhoxdatmN6cpdhHRGTTJE6zmXwiLFv cmkg== 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=TVsrRmuCxIDTU92vEnsCByOwM7gov1/gE6GIbq2IbxA=; b=ZKT1PuCNns7F4OFs1R96CAKzgy3nyovcLDSd7WVOfrg7Lr7mYg9CbHPUCiSGAlZYEB 7+4fJYu24t1h4wLJ2T0OzRTkJeY9L8KhoXglJxjLPUTru+gzq2RipG9Dhtokw3IOU5pr RHKPMHa60PfB6SiOfZvL4xyREfhETmoBD7uqUG87w58gQp3+HR+zwVSZzoEIqok8xLoZ NqWpo3iXrVcp15uc2y9UJOfCaB0J4YfltcMNxYQldocFuCaOgDRRdEAqN4L9tNJH8U+y CMp5U1MwBRmFGd8j7WgNfGaDOKkoWGYiaJ8JFmppVhX8hkbFSPDX0q1YPj2R6S+K9bm7 Myeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hLWfwKBr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 l15si40032758jad.101.2021.07.24.14.22.21; Sat, 24 Jul 2021 14:22:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=hLWfwKBr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 S229795AbhGXUjt (ORCPT + 99 others); Sat, 24 Jul 2021 16:39:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229510AbhGXUjs (ORCPT ); Sat, 24 Jul 2021 16:39:48 -0400 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 312ECC061575; Sat, 24 Jul 2021 14:20:20 -0700 (PDT) Received: by mail-ed1-x534.google.com with SMTP id da26so6349462edb.1; Sat, 24 Jul 2021 14:20:20 -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=TVsrRmuCxIDTU92vEnsCByOwM7gov1/gE6GIbq2IbxA=; b=hLWfwKBrq92s9szZs40HRbtE6zX1jKISQxkVQ9a28msYg2c1pg/3NPWRJSIFDVlulu f7Jn04tmo87qagVP6zB2UI+DaL0wiY63FmO65ZK4GZIdP9ecGVSzCB2tpCUkJ5tXFUYU 5E5Ojfa6/Zs86uElYlIYkRB/EmeyY1LrsxS1acIi0tsG59hJqtaP92I+D4sNTOidRDE6 x27bkkGMYipBvi0sGT76ix39JvJizf8RMVZEVhqVEwhZjGuc3iN/DRHybhLK1Xk6BVwx S99DWjC8qYmFhOlruep15R1zuSsZHO2wGdg9KhKShHnuZHdDjbW15jlTtfXktUf3XH5b jYEQ== 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=TVsrRmuCxIDTU92vEnsCByOwM7gov1/gE6GIbq2IbxA=; b=pZ5CYNHpH+zz54Pf/RWuF5ykIHLe2PdurnkGCv1xA/Bt0bBDH3bDJ/kvowK/uFfs87 Ah6WgevksnFPeVSdHbDSxP6KOxz7Zt9QTnRLJCVwF2y79SJK242Iuziucpu7vzBglF8j /JCfUwHFxtTRx/qd1boALv+51NTAHzLt33St2eiui4LZKo404uBc6DmsUUnHERGrrexB yfghjO5JuuIk3tVEA4RiOfM3DV6dv7j2gsWEpQv3YudRJNCmj0Jc+X3kjDU0I7GV778q imnOYBsDRsfcH7VkrbD+2QjB6At+rJqYejquKZkLv0+aR2MhUtVmlkcfWmUgEZO7PdzM OAkQ== X-Gm-Message-State: AOAM531wO+txGcyK7PQAees7Vav5Rt/2cUym6pBiq1QsarOQpqxReiwb pYReHXDzDgNsUJH1PNts8+Q= X-Received: by 2002:aa7:c74e:: with SMTP id c14mr12985143eds.40.1627161618871; Sat, 24 Jul 2021 14:20:18 -0700 (PDT) Received: from pc ([196.235.233.206]) by smtp.gmail.com with ESMTPSA id f1sm14948971edt.51.2021.07.24.14.20.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Jul 2021 14:20:18 -0700 (PDT) Date: Sat, 24 Jul 2021 22:20:16 +0100 From: Salah Triki To: Dmitry Torokhov , gregkh@linuxfoundation.org Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] misc: powermate: update the reference count of the usb interface structure Message-ID: <20210724212016.GA568154@pc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use usb_get_intf() and usb_put_intf() in order to update the reference count of the usb interface structure. Signed-off-by: Salah Triki --- drivers/input/misc/powermate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/input/misc/powermate.c b/drivers/input/misc/powermate.c index c4e0e1886061..69dc3347478a 100644 --- a/drivers/input/misc/powermate.c +++ b/drivers/input/misc/powermate.c @@ -337,7 +337,7 @@ static int powermate_probe(struct usb_interface *intf, const struct usb_device_i goto fail3; pm->udev = udev; - pm->intf = intf; + pm->intf = usb_get_intf(intf); pm->input = input_dev; usb_make_path(udev, pm->phys, sizeof(pm->phys)); @@ -428,6 +428,7 @@ static void powermate_disconnect(struct usb_interface *intf) usb_free_urb(pm->irq); usb_free_urb(pm->config); powermate_free_buffers(interface_to_usbdev(intf), pm); + usb_put_intf(pm->intf); kfree(pm); } -- 2.25.1