From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 606DEFA3728 for ; Wed, 16 Oct 2019 22:00:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2B4AB20872 for ; Wed, 16 Oct 2019 22:00:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571263243; bh=Ig9XCHHU2qVu85xjuwYavYgJ/lRzNKn2H+xGprt53V0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=hOxzvlB+uvJISoJXRCI4Uyej8kRXBbKH4umdRCNbBWGhPRQLQKQV/k1yfPtG8evw/ vN7RHss8zKPoCpIGP2mVA+ukxVCdTlTqyVn3NoJATammhyIHJBP97Lv71ZETo4+MHI AWtTPezIS5lsEQhu1Xj9BBnJEL8b7mPx42NkChlw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2438858AbfJPWAm (ORCPT ); Wed, 16 Oct 2019 18:00:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:54526 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2438549AbfJPV7e (ORCPT ); Wed, 16 Oct 2019 17:59:34 -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 29A9C21925; Wed, 16 Oct 2019 21:59:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571263174; bh=Ig9XCHHU2qVu85xjuwYavYgJ/lRzNKn2H+xGprt53V0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hLbu5/N5bztuHTcU2k1Mq2xi21/jdM9aCJbWBozbt19StO2LuwzjpQZ2BmuTVZQZ4 MUc/NNLIiDhiNWsu+KAhtx3HPupUNGjkJLetCPMSbKKNjf/8IJwaf1IokighMC0zMX SB/v0hEBcJ5z8hipWNxoBx+K9TNB7x6MsXAbUPCA= 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 5.3 101/112] media: stkwebcam: fix runtime PM after driver unbind Date: Wed, 16 Oct 2019 14:51:33 -0700 Message-Id: <20191016214906.560739268@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191016214844.038848564@linuxfoundation.org> References: <20191016214844.038848564@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 @@ -643,8 +643,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); }