Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp193818lqp; Tue, 11 Jun 2024 01:13:16 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX5zsoJuv5zSACwVfjVmFBsIK8ZmM1tZYg+XaX1QdR1AwI97feaJKEqal3qjiVxFwl2VIE0upltM2BsCSy6YwzwkMRubtpIh8j2CUM0Tg== X-Google-Smtp-Source: AGHT+IH2o4b5gIWWsvu0Yft2aB1D1jLygJhnPaUa2qFv4xf4p7zQntEv11gAVYFcyHXt5yI/uPqW X-Received: by 2002:a05:6214:3d05:b0:6b0:87f9:b552 with SMTP id 6a1803df08f44-6b087f9b5cfmr30519736d6.0.1718093596206; Tue, 11 Jun 2024 01:13:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718093596; cv=pass; d=google.com; s=arc-20160816; b=kphb1ZqVey9lsmZsbvLPXl6h9GVbj0mNRU1bGswNMm0LN6AxuwSgcaoQ4HMTr2VnPV j8H8JYt7jjpfKSb3Eb4ImNkWiaxvfXPZPWngDr6UcPQ2HN7nIXYrQfmIMo2kJAdLTazw YzW1Nj2e2bnPTy3cuO2HjEi0XUp3icze0WQpajxWIiYAdEXZCAJykIAum1SIo5Lvv9zq IpDA4r8ghRjkZvHD1R7Ra+49RKCFAAKAo6WziScJYk6B443kRT2RDiiq0aWGSMKNPxSC ZCORGeExJXTHmwWbSxiTekKSYOdlJshEWXxWZCfF1idG9F5BhQG/r2u1vsCQzTYwcHwM FMsQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=8IVYq4GaETsYJZvHz4dUOl+klY8inCplH9StLoFX6IE=; fh=wJ3MxaUWqxAodC6+kwDELzO2OolfOMG+Zvbu3uEWUYM=; b=BzfjQjkeUBifRkoZB7iJ5rGqD47Uqz6HZjlaoCBDZvZ8bBjemOcVgYbEP7kWhQpJwJ uc29UkTtd6SqwjEe0QMDdYSsyENn9Hdiy6CHF6b6zhgQoTmWqtD2bgqrFPix8ovjwGO9 a0iSn52G0HM3OyLq5ucowjdAj7+B7GKQeqF+BHSa+S4Zv6wYpOFPXni0B/7joIHqib0g UrThzmrWSC8sUllxUDQV7zfSYGFRlXwRE5su2S22pk1PPylcIuEZDrTLA7U3XPrEvtEV K6UIT5fzULVIJEoOW/USRAAenydzvtR9DyQ4WY1bdZCKX04xYV8hPQkqMBk320PcPW1e wQ8A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=nStDVCZe; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-209455-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209455-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 6a1803df08f44-6b071a68febsi72785036d6.22.2024.06.11.01.13.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 01:13:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-209455-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=nStDVCZe; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-209455-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209455-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id EBBFE1C234F6 for ; Tue, 11 Jun 2024 08:13:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2F131176241; Tue, 11 Jun 2024 08:12:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="nStDVCZe" Received: from mail-qk1-f178.google.com (mail-qk1-f178.google.com [209.85.222.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C60CC17555C for ; Tue, 11 Jun 2024 08:12:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718093537; cv=none; b=dUsd/48QXFYxawAEUgnZsrC9KUCVxGkbHfg9gkD2qq9kXaP5nN7am0Jwo3aqwv7FfKk4nHkHhOXXHJt98QXXwBDbc9+OIgGgNKyslZY3ZTYTnXdO/5hSFOUHzB+Jo8Au2pldybXY3rP79RuTMJ0udHOd4HaNDGuGESsv2GYKPEM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718093537; c=relaxed/simple; bh=lM/AUoiIFm5wy7ofM3hcaSkgrO99OY8cJt9TzA0Mu0s=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=f4YY9OLqK/89nppk5OY78hGQK8Oqgaf5n8s6+xiM36/QKdhb9w21fHrdNK6rOSbjjltSh3WYGXdWns94Xm7MpyxARd23c6z5S8SWc5RSBYqob/FxKF0u0yM9BkU+5qzd9b4wCMtctPflRPrhy2AZvB+WphvblpEvCsBLgwk0cec= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=nStDVCZe; arc=none smtp.client-ip=209.85.222.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-qk1-f178.google.com with SMTP id af79cd13be357-79776e3e351so100852685a.3 for ; Tue, 11 Jun 2024 01:12:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718093535; x=1718698335; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=8IVYq4GaETsYJZvHz4dUOl+klY8inCplH9StLoFX6IE=; b=nStDVCZevNT9SyOrBoB7mnUoLKiiwGVSD2F0TwP1bKY+x2bwmBZN/GpYSeH03U0bqH dL45y9NWX4S2Fn1TUpxlwCFbvZpa+taWRc2SIaixMEOhP5OdQ8MvBN2qmAEC5LEcGL1G qky0ntj2rb3YUpHQS4/NzdBz79DmVpUNmQ1YE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718093535; x=1718698335; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8IVYq4GaETsYJZvHz4dUOl+klY8inCplH9StLoFX6IE=; b=fReXVuX2EifIFJNV52bhOvhHQ2juTih7oAoEuIp2QZ91jRL5oJ8cxcvJ3TfwY5UHNd yzJFCfjCzqQIBoqhXtwKwkzg6Y0Qt7lTQd0lTkw3HjScz+LHXj35d39OjFIqnNh7w4H0 GPp1gDdOzg8iYsdZly/XbYs5xoRaBcdbxRP76dqIPykwp3ROsOerthRdxxtP1cmtllCg myZ8vAoz1NvF2zOZiQ0tKatC1K15cVr+HdHmugZcDnva+JdMRz9Qdf7esDdYn+CtUcyT dHd4EfpaBZMvHaV95enTHj/ZWEp9p2KeOdwzQoctpvQZ2WJ9VflDL2hB5HpFTF3NtkBA g1dw== X-Forwarded-Encrypted: i=1; AJvYcCWQxpXqAi6z4CvYdAP5hUJiKdAiicj2NH5Zx0FQRevlek1KvP8tRd6QAWikgjnlDaMTF3cL3fgU0s1QUHbxWcPOkXZKPQVnZoOGw2xo X-Gm-Message-State: AOJu0YzH2tpD3igOn254H3hkAnH4Qmo3ZPmK6vahxlDZevk5sG4+ZtJf dmscYhDRVeMzCeeW2p0wI3pUklHVZlJz3M+kW3owuUqPKXM2Im8y1gv8LzSxtw== X-Received: by 2002:a05:6214:319b:b0:6b0:8e1d:f71b with SMTP id 6a1803df08f44-6b08e1dfafcmr6921546d6.49.1718093534519; Tue, 11 Jun 2024 01:12:14 -0700 (PDT) Received: from denia.c.googlers.com (123.178.145.34.bc.googleusercontent.com. [34.145.178.123]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6b09039c2b9sm1548886d6.28.2024.06.11.01.12.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 01:12:13 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 11 Jun 2024 08:12:09 +0000 Subject: [PATCH v5 4/4] media: uvcvideo: Exit early if there is not int_urb Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240611-guenter-mini-v5-4-047b6fe5d08b@chromium.org> References: <20240611-guenter-mini-v5-0-047b6fe5d08b@chromium.org> In-Reply-To: <20240611-guenter-mini-v5-0-047b6fe5d08b@chromium.org> To: Mauro Carvalho Chehab Cc: Guenter Roeck , Tomasz Figa , Laurent Pinchart , Alan Stern , Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Sean Paul , Ricardo Ribalda , Sakari Ailus X-Mailer: b4 0.13.0 If there is no int_urb there is no need to do a clean stop. Also we avoid calling usb_kill_urb(NULL). It is properly handled by the usb framework, but it is not polite. Now that we are at it, fix the code style in uvc_status_start() for consistency. Signed-off-by: Ricardo Ribalda --- drivers/media/usb/uvc/uvc_status.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/media/usb/uvc/uvc_status.c b/drivers/media/usb/uvc/uvc_status.c index 8fd8250110e2..9108522beea6 100644 --- a/drivers/media/usb/uvc/uvc_status.c +++ b/drivers/media/usb/uvc/uvc_status.c @@ -308,7 +308,7 @@ static int __uvc_status_start(struct uvc_device *dev, gfp_t flags) { lockdep_assert_held(&dev->status_lock); - if (dev->int_urb == NULL) + if (!dev->int_urb) return 0; return usb_submit_urb(dev->int_urb, flags); @@ -320,6 +320,9 @@ static void __uvc_status_stop(struct uvc_device *dev) lockdep_assert_held(&dev->status_lock); + if (!dev->int_urb) + return; + /* * Prevent the asynchronous control handler from requeing the URB. The * barrier is needed so the flush_status change is visible to other -- 2.45.2.505.gda0bf45e8d-goog