Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp2341194pxv; Sat, 24 Jul 2021 13:00:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvqWRd1WDUD5Mr8wjlmfnUQgTwOKXk2p3G7EqYKGKoeboTmihIuQC0eOSikYiKRPE81+9b X-Received: by 2002:a17:906:3006:: with SMTP id 6mr10561143ejz.73.1627156835029; Sat, 24 Jul 2021 13:00:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627156835; cv=none; d=google.com; s=arc-20160816; b=UxxyW+3BEjzWxAD3WxoVLkc1ODEvdzVpCDcoYgNT4Si6L1alJjLO8IEnd9tUfTy8bv FG5VuRiuMuX+fNRwZWe8HNFQ03czUS+9XLCv2njAIljtjAA6SPPgblhpaDvpg6tECktf +S+hKsQn+m2R36VkZRpa8aa3l7qsBRZcEt2Mm2XkZjwpVd0RjoW+qdl8Vd+r/CVGf80W GQAShsLDqbHN3OnDHuQINSFkd8WrmnCNZeTg6zgQ9/XrmCtOmPq0Mn/GowfHeN3z6ytT s5+HLfjxeuZ1PSYBI1AW1Iy1cc1czzSPux3gB5F5NKDKxpdWEabz7vn8qVVsyF6jEUS0 FIkw== 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=nQ55jVTuVaUag5jlvVen69IRc5bdGGnJg6RE+nxxubE=; b=qftYzFCRKY2Umcl/LOPLgHcJobTiNVCXaVra6qKCeRf3s8y5X7kyWGt0iEYEqrMBKP efsTjN7ttMZNAAmDMSRr1ehEFQqOF0VtHgoOQvS3qFzzsm7s0TQk/fc/84UreGfNGdUU zrRee0zdE/c0+YzeUTYCrJB08w0XHRO/Bh+D8dUHuvO7Lh12HgA81L+ymyKU3c/TAdd1 MCh1y1cxqii5gZ7fq5D20gjDNWD6EeeXKxp8N3+a2lwiO5pRUi9GOKg0YWzZ8aB3YOzU cebqb1G4mBV13SBN9Re/jLWmHQ2HNZiFHSMfQNmijPvkyyZJbCCPrOQry0h1lYuJ2K6K m3LA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lJF81UVG; 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 v17si35582675edy.2.2021.07.24.13.00.10; Sat, 24 Jul 2021 13:00:35 -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=lJF81UVG; 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 S229645AbhGXTSI (ORCPT + 99 others); Sat, 24 Jul 2021 15:18:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229481AbhGXTSH (ORCPT ); Sat, 24 Jul 2021 15:18:07 -0400 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC6F1C061575; Sat, 24 Jul 2021 12:58:37 -0700 (PDT) Received: by mail-ed1-x52c.google.com with SMTP id r16so6120241edt.7; Sat, 24 Jul 2021 12:58:37 -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=nQ55jVTuVaUag5jlvVen69IRc5bdGGnJg6RE+nxxubE=; b=lJF81UVG//3ba9IFLpz77tfLKt9Bel+4cVdeP07YcG4kRrNAe/YQv2E6DVYvd7Wrq1 EWgD5CbNRXrlRgu3VVF0S4ToTAdBNERbthehWbyl8jFC+zD0SkN1gMDH6bLCzvi+ab5t ZPfBtaxzyImbItZS0MC9DspYnktBiFGohTDoFuf2vxZGmiKNxJYEifGFhNxOOeLUe65h rnOKo4ArZ+ruj5GzuN7jX1ERNmfHqq8/wHkW+n8wia5WbCKqjBD4pNYnz+fNlkjclhVw j7TqkIArcCXdI6Rfu3vxxrlK/FY/b534F28n480F8PmVHvJEqNPQQ16SHNkeI+AdCSEG jvvA== 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=nQ55jVTuVaUag5jlvVen69IRc5bdGGnJg6RE+nxxubE=; b=mpu43teVN7N55B/lDFMuDagke68MaAxniia6DPpbDx4frhRRP8jgJ+4Goy8vLzbQnJ GDQyqdLHMJ0ZwjmyvqNBF9fRn9W34bxCKDdegq+zn0ZRerv8y1ipPqrmrGNNjvKZvoiE nPuzzSHXU2Dj02JWpV7kBvgWsZwfjSm+9VArRbrqtzFL+6rXVkgepzua7zR+l9GaIkR5 tzHsh+I1ctT1rGhluCK3WB9Bxj/Lf1meeVUF7gQM0MWbSoSpTS0tSzP+KqRQvIRU7U5S qs53L3Vt+ts92UflpWtd5nLXDwCp1anqUPLAOwDErkZ1niifE9pl6oJGoBAC+2Xx+ivl Q4RA== X-Gm-Message-State: AOAM531SXmvBioKGgQvPFeZ0WKPI3+Mkv4hWOTA9zexPFtNpt7ihdnRc ShzLt0C9rpVhdQ8nNcLNn4I= X-Received: by 2002:a05:6402:64e:: with SMTP id u14mr12598627edx.122.1627156714870; Sat, 24 Jul 2021 12:58:34 -0700 (PDT) Received: from pc ([196.235.233.206]) by smtp.gmail.com with ESMTPSA id z8sm12723271ejd.94.2021.07.24.12.58.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Jul 2021 12:58:34 -0700 (PDT) Date: Sat, 24 Jul 2021 20:58:31 +0100 From: Salah Triki To: Mauro Carvalho Chehab , gregkh@linuxfoundation.org Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] usb: stkwebcam: update the reference count of the usb device structure Message-ID: <20210724195831.GA509821@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_dev() and usb_put_dev() in order to update the reference count of the usb device structure. Signed-off-by: Salah Triki --- drivers/media/usb/stkwebcam/stk-webcam.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/usb/stkwebcam/stk-webcam.c b/drivers/media/usb/stkwebcam/stk-webcam.c index a45d464427c4..3b14679829ed 100644 --- a/drivers/media/usb/stkwebcam/stk-webcam.c +++ b/drivers/media/usb/stkwebcam/stk-webcam.c @@ -1309,7 +1309,7 @@ static int stk_camera_probe(struct usb_interface *interface, init_waitqueue_head(&dev->wait_frame); dev->first_init = 1; /* webcam LED management */ - dev->udev = udev; + dev->udev = usb_get_dev(udev); dev->interface = interface; usb_get_intf(interface); @@ -1376,6 +1376,7 @@ static void stk_camera_disconnect(struct usb_interface *interface) usb_set_intfdata(interface, NULL); unset_present(dev); + usb_put_dev(interface_to_usbdev(interface)); wake_up_interruptible(&dev->wait_frame); -- 2.25.1