Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1345441ybp; Thu, 17 Oct 2019 11:22:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqxkbdZZ5JEfWfh7jbpuGl9mG7ZGMJnpHpCeJQAT65Hsd89yfmj0zEOVRQvD4GQzzAT/C5Zz X-Received: by 2002:a05:6402:895:: with SMTP id e21mr5209948edy.72.1571336542513; Thu, 17 Oct 2019 11:22:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571336542; cv=none; d=google.com; s=arc-20160816; b=GHfOj4+r2P6qBOrZKRean3XyEDkYNc4tAkZVrmFRJsWQfLLgZqm+iJD+Dl4E5JorCr eit+PSC568JrwiZf+vHsl1MHiy7EoLEb2oP38WEkTjShsD9a5AQwdhzSdLLL2QfTKtD4 JmTg9+Y32QZKIKHzD2PtCb14IA4d/AOzntZlP87nGF816jT3/x/rdjSIjoEm3bdbxoIo M7uPGAHxTW0zzaY7J4lUj6cDaROBvtWPafxfM/7XSo4+6+jwNTBUZ5oTeszC3K4XcxOF Tsj/UIfpbJDZaL0hiPerwQ+tRx1ZK9mK1WuyRrkgVDG32JlUnUTN0LmovRZs4pQ5m6JF SKzA== 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=hB6b/w31OjD9tY6RJ2kexBuYx1M9dY5E3Q8Cw3gkqlY=; b=XkFhwKUrnmbNzqA8g2jzadyBNpgynLUr2SYgkJHck1Tkflk1z4ph08hdiIcKKvaTv6 u4qvKikwYirdTH2xZsiMMWg0e022vl1BDmQhv8WhzviS0G/VA9ybxDMpz6353tsHMyLK NojY0jZlXNkSC3KUqfVFhT8OnR62GkgR/b1ngKo06eIcCA/m+170xvPxeaHu6dQSkvGF Er5IIj15JPd2gQeiVXWLAp3fdmarSc9w04u/HVry8izduEzaEgCC3G6omp9TCowYOjWZ 4uWgxkWBXTQKvvjarkuhm8uYucRzkAHyXlc8FDZ88o8y9wWVygVNTS580QGtmNGT3s1C PmmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="hLbu5/N5"; 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 h17si1814023ejt.173.2019.10.17.11.21.59; Thu, 17 Oct 2019 11:22:22 -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="hLbu5/N5"; 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 S2438853AbfJPWAl (ORCPT + 99 others); Wed, 16 Oct 2019 18:00:41 -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); }