Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp240551ybi; Wed, 29 May 2019 20:27:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqxR8Xq+qsFZnQccYRENaeYcvhWbQgSVPkNSKTpJEvG+i3CjnrFnnMs7mnCYSjJFaYyX8MAm X-Received: by 2002:a63:470e:: with SMTP id u14mr1628041pga.135.1559186821239; Wed, 29 May 2019 20:27:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559186821; cv=none; d=google.com; s=arc-20160816; b=xOxbaAp8nUWiSFcBMuleKN/oQgLBZrRYf/gM9/rCdgBw4N0ndNOoM9CJpEt3VFJGzb mHhIEByALcz46EGscAw7yJiCIxxq/vMvaJ8ybYblw3wg1vwtV3X4LIqmILiWOOwPm63t dP+V/uJlW18snUTDB02tvomqX3JkW1i3Cyrsrk2Dei2vSmDgmez0bZgfzipFxwjcb1OA lJLJKa+ui48ClaAoBhgOIULHn92W3M0eMuJxznmoCDPElZEm7Q7NwEHoM7v/FhRYkzs9 j/vsEmDg5Ff65D4qzITU/7mvlXZJGzRaJP16hbhiQ8M8GWewGfJtZhouRsp4AmkDWlVk fQaA== 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=yPiR408XeT022+5EkSh7uxgZULF1uMwAG8tsxT5N1XI=; b=KyZFc4mt33nP7L0tUWEdTXP6XDNlc2CS7BK5oC0Hlv1F2ekeSN0Nn//gDN5n14IDav 4WMzzK30PoXAcuvEzpNYc9rDyutFV5hSP+MB3D/75IFZ9AktV9EamQQnWoxKGn8JLoRs RHxiHzDQ5f4YSXrxbX8mDTywu1VN/EgTlSPHv13nVn1k3m8ImhwgrzXkdtN+OOEe7xCs wnS6g/XmygscBy2scyl873DcCSwoilfnZ6iCxRZsm42Ac3oWXeITrKdcvW98POJXKQ5e fmhQ8/VSNCmoNiDNG/J8GCaD4hx+90ljcnnOrVomPcxBuaagzsVFUrENfYVjwUPG037P fGug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="t9NfTeQ/"; 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 135si1910021pgc.346.2019.05.29.20.26.43; Wed, 29 May 2019 20:27:01 -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="t9NfTeQ/"; 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 S2387442AbfE3DYs (ORCPT + 99 others); Wed, 29 May 2019 23:24:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:50012 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731487AbfE3DSQ (ORCPT ); Wed, 29 May 2019 23:18:16 -0400 Received: from localhost (ip67-88-213-2.z213-88-67.customer.algx.net [67.88.213.2]) (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 DECD624797; Thu, 30 May 2019 03:18:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559186296; bh=HlqsrYSyKxnRC0lH59ph0ZTOGikuu4WjthtcOBJPZ1M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t9NfTeQ/54mOte8RUTFP7uyOh83EemTXw5j6+vfV3zd+8pjYfKG9Pr9gI5WYFBGHF WRfNike8/J90Z8WElRG/VvF5RZD8AoNAwrN3tNTWCoSAqgNNw4IpH7XOUe9miRIn2k pYdYYWAAqj9AarlnktLjgq7AEiR++eMeSpHUa4RI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 4.19 257/276] media: gspca: do not resubmit URBs when streaming has stopped Date: Wed, 29 May 2019 20:06:55 -0700 Message-Id: <20190530030541.254790523@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190530030523.133519668@linuxfoundation.org> References: <20190530030523.133519668@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 [ Upstream commit e6f8bd59c28f758feea403a70d6c3ef28c50959f ] When streaming is stopped all URBs are killed, but in fill_frame and in bulk_irq this results in an attempt to resubmit the killed URB. That is not what you want and causes spurious kernel messages. So check if streaming has stopped before resubmitting. Also check against gspca_dev->streaming rather than vb2_start_streaming_called() since vb2_start_streaming_called() will return true when in stop_streaming, but gspca_dev->streaming is set to false when stop_streaming is called. Fixes: 6992effe5344 ("gspca: Kill all URBs before releasing any of them") Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/usb/gspca/gspca.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/media/usb/gspca/gspca.c b/drivers/media/usb/gspca/gspca.c index fd4a1456b6ca2..b12356c533a65 100644 --- a/drivers/media/usb/gspca/gspca.c +++ b/drivers/media/usb/gspca/gspca.c @@ -314,6 +314,8 @@ static void fill_frame(struct gspca_dev *gspca_dev, } resubmit: + if (!gspca_dev->streaming) + return; /* resubmit the URB */ st = usb_submit_urb(urb, GFP_ATOMIC); if (st < 0) @@ -330,7 +332,7 @@ static void isoc_irq(struct urb *urb) struct gspca_dev *gspca_dev = (struct gspca_dev *) urb->context; gspca_dbg(gspca_dev, D_PACK, "isoc irq\n"); - if (!vb2_start_streaming_called(&gspca_dev->queue)) + if (!gspca_dev->streaming) return; fill_frame(gspca_dev, urb); } @@ -344,7 +346,7 @@ static void bulk_irq(struct urb *urb) int st; gspca_dbg(gspca_dev, D_PACK, "bulk irq\n"); - if (!vb2_start_streaming_called(&gspca_dev->queue)) + if (!gspca_dev->streaming) return; switch (urb->status) { case 0: @@ -367,6 +369,8 @@ static void bulk_irq(struct urb *urb) urb->actual_length); resubmit: + if (!gspca_dev->streaming) + return; /* resubmit the URB */ if (gspca_dev->cam.bulk_nurbs != 0) { st = usb_submit_urb(urb, GFP_ATOMIC); -- 2.20.1