Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1388887ybp; Thu, 17 Oct 2019 12:03:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqx9GUOtMf2cdPjLFx3D5urf8xmHf98GQaBN67aC6EdmiMeRx/KnBIrXVUyrSwYsfAS8WE3t X-Received: by 2002:a05:6402:1b92:: with SMTP id cc18mr5588717edb.129.1571339033142; Thu, 17 Oct 2019 12:03:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571339033; cv=none; d=google.com; s=arc-20160816; b=qbrk5hybmK0HuADpc4Z47UlGVsvNJZAX/ih9QoUO1ZVA0FBczDKu13v21nrgShRSJY JzVdNZhgex0yxJDcTPRdo9YODcwpRlfr7vt8cfNw9JlHL9UlWBLHmEUU7c1S0+brvnLB GvidcDD3BT7Yia+3l3AOiPwWn7HpUhvHNKepzT6xOHWyuwwUEzvLo9QhnVSc6fonxGWp vf0yEaRfkXUM8MXvAkhMY9uVY6+HN7c7d+bZ7Dtj2Ut8bJB8BQXfpfW7yi6Aim21Zypc zZZMj1RxGricLKYTTyWiDd0og2fnqJWI4EmX3Y5QFlCkYkduJR1rHcBODXDJyeBhtUEa TvVQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=J8/mFGBI2z95BMxj6mhKRimqjZxRXNs4OfDmXywxc6k=; b=iCqgQshC5q/uKxSRk9v5jtXm96KnGYB+0XVvj4++Ls/ebbyphPwTVfygXjw4HuOWv8 eZyMMyenJRfPt1lFH1Rz9Bopo+HPoSAr6UWSkJqfFmnmXsE3PV7gmGi1rN4Xf93xxWyA PNr6ovnq633lS1wCjMvmZ2cOarjTfcMN/k56vm9m8oaZ9pavDSzH2uul8aZJ+0MOEsyV 4/6rMd6MempoYJ4u/YgbuQiiMc5CKgilIWpRlqjd/iqILK/DPVIDIBg5kttXGEId6raC Ifq2mZOqAQg21m57u5QNyvbHGjAYpl7FbdbQJ3V2WgpPfr5IaSgzN/mDfzFStOQqgRFh MO7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=e8XzwG6D; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 c54si2276841edb.230.2019.10.17.12.03.29; Thu, 17 Oct 2019 12:03:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=e8XzwG6D; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391338AbfJPWMG (ORCPT + 99 others); Wed, 16 Oct 2019 18:12:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:48192 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406664AbfJPV4c (ORCPT ); Wed, 16 Oct 2019 17:56:32 -0400 Received: from localhost (unknown [192.55.54.58]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A692121D7F; Wed, 16 Oct 2019 21:56:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571262991; bh=HoRzh6UsjOv7XLwXkaRnDIDGMA7ZCSYunRRpeGX5F2E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e8XzwG6DiXfdMvPFaj2jukPOADVF6xD3mMnHCFn1sNKgzpDVAP/ZLDIQ3f/v0G8T8 73MA/D2fu9I27jjG5XRp346PdkFB7VpDocqek2rvktWdPob7R0unO3ijcUiUFD+hRX yKMWjSAvcLXvPjNpwqBc0mfhv/Fye0Xk/Nu2yqlQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mauro Carvalho Chehab , Johan Hovold Subject: [PATCH 4.14 59/65] media: stkwebcam: fix runtime PM after driver unbind Date: Wed, 16 Oct 2019 14:51:13 -0700 Message-Id: <20191016214839.302002408@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191016214756.457746573@linuxfoundation.org> References: <20191016214756.457746573@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Johan Hovold commit 30045f2174aab7fb4db7a9cf902d0aa6c75856a7 upstream. Since commit c2b71462d294 ("USB: core: Fix bug caused by duplicate interface PM usage counter") USB drivers must always balance their runtime PM gets and puts, including when the driver has already been unbound from the interface. Leaving the interface with a positive PM usage counter would prevent a later bound driver from suspending the device. Note that runtime PM has never actually been enabled for this driver since the support_autosuspend flag in its usb_driver struct is not set. Fixes: c2b71462d294 ("USB: core: Fix bug caused by duplicate interface PM usage counter") Cc: stable Acked-by: Mauro Carvalho Chehab Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20191001084908.2003-5-johan@kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/media/usb/stkwebcam/stk-webcam.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/drivers/media/usb/stkwebcam/stk-webcam.c +++ b/drivers/media/usb/stkwebcam/stk-webcam.c @@ -640,8 +640,7 @@ static int v4l_stk_release(struct file * dev->owner = NULL; } - if (is_present(dev)) - usb_autopm_put_interface(dev->interface); + usb_autopm_put_interface(dev->interface); mutex_unlock(&dev->lock); return v4l2_fh_release(fp); }