Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2396509lqp; Sun, 24 Mar 2024 17:40:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVkmUAiQPLvduBaYCSF1Lbsg5BF3NiFgFHZ1jwu4n0TTQYhitvC/Sd5a5z8YgEyi5Ut4TIWN0ahj7qLApSQ5RckZuZsGj48HBrElhK1Lg== X-Google-Smtp-Source: AGHT+IEeyoiAP4LQZFgkqjDnHUX5cgEm6Xn6h1anMvTfiGkkyzQEFo8vX1v20rs2KFsXmJKFKw21 X-Received: by 2002:a05:6358:785:b0:17f:56c9:95e4 with SMTP id n5-20020a056358078500b0017f56c995e4mr7355346rwj.7.1711327253036; Sun, 24 Mar 2024 17:40:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711327252; cv=pass; d=google.com; s=arc-20160816; b=YOJCFB0OooZ7bjuWRou6oPnxcsT3fYHV6JyFqYgU3zjrG4aySTXJFCmVjYCuB0jJR5 5bpbngqXB1apVBve9g59R92vWML80QXpeMDsMCaIUaUMpU+RZKlHJQrrDc/gVxyr6TLi 1kauXayuuXivF7fi1EC8HUUV0AtkBsQuERSxHDBqblcgP2fWu0PhFBJmifcgOhLL92ho Tcu1NU7riGRB42Wqdy1JApkccCJvxtt6AC+2YMXBkGfmO8k069ujYY3/TIx99oDNFm9p 5Cx4oAR/cOzhBZwNPBBEPSo0Dj41JX8dbCwBl4uW89mCUt45U9cA8PAoyLd1CCqiEIAC gvSQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=20rDPbGLC1cWEPLEuCnE+Fxy0nbHZrshgaB7JDoLDuA=; fh=+RvyclY/QMfD6sOM+qqHR+o8/xKcOas+6eGP9cLklJ4=; b=StyOfb6eLnSMG/idTBmKjVsWXrbNxTVgwfzRcK7m1szsveB3ZcGGmE4lIh9Mhu4ngY 4XrwoVlocn6mzNhhp+KY9FANGbbkp6XmnXPITRSX1g9DL7KKy980sFKxn1UjvIx1FAdO TQ9yTsq6a/kK4EO95MhJ0EUflFgIqh859Z7La3/2VM7kbtY/xKRoLcH7CBaNacEusYB5 miskJC5LpVz/OnCYuSZd8c+Mnjkb0GNjr4/Pz7DGmn81BxcLnueSnKnG4aql/8t56yhL 5d3+LvwlJ5j028i9xjEf/1zargmfb0z+lr+Y1UhV9qXHP2hAebiyEUqUXw9Y3i7Qh/l1 Apzg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="lD/nE7s2"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113400-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113400-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id c190-20020a6335c7000000b005e5271aafeesi6748074pga.403.2024.03.24.17.40.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 17:40:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-113400-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="lD/nE7s2"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113400-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113400-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id D55F3B21BAE for ; Mon, 25 Mar 2024 00:27:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D36A61A437F; Sun, 24 Mar 2024 22:43:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="lD/nE7s2" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E9F171A435E; Sun, 24 Mar 2024 22:43:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320202; cv=none; b=IExBSY+7Gf8IOk273MiTS0j7Pw1/BiWN+sYU1JU+kS7aAEvigKxN7XTOjUkAr011VXo3OKXPUhtED1Mstqm8JMEdgY6TnW0DgKzh38GEPGXTN0RTqQC7WDnPtdZiNxGiwklx5JDNzrt7OBxA++DHNBtNrEwPFID8EfbQfKiwfh0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320202; c=relaxed/simple; bh=7OARqTesKM/jiOLpZPeVkEL/uYEhr73hABYHiTOiYjI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ifBgOBmtDyTVVbzkfyPb3g4ZbbJG5Q3jra68y57bY7w8CxCTZ0GVsq6itsJTpmy4IFkTAjAMTv0e4i8bNJWC/8bdFynowqXrErVJ3ymuBOcBCJVLcar/vC1lUejjM7C44aq84U/xBfolBvpiGrr2G7VrhOF/CzVC/gJ1XwpHFMI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lD/nE7s2; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 19F8DC433C7; Sun, 24 Mar 2024 22:43:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711320201; bh=7OARqTesKM/jiOLpZPeVkEL/uYEhr73hABYHiTOiYjI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lD/nE7s2XVKmOWcb+ulcNeFf9hRMCnFP+g1vAomI/2byBZDPZXBUgL68fxKDofmiz uivDiZuaZVCX14fZ+o2nDyQCZx/L7axv9hUC/IjV6UlWq5EJFbNIhYUduKdnesQV8Z k3UH6C5a236gE/8eQ7csUmQjlx0XTf3e+UPCpnznn1f4tITO2X3lX5uZlzY5uPjNy5 JqVE4rpExwStKBeiOikXLXkBbPv0jijCEAdQBN1OVnu6KzSo5xNwPd5pzfE7cZKQrd semg7yg6qfq60N9XtFSg0/LZS1qsVjoSISDS2gHPRjcZkEpW0oMORiwTacxvVLTteC MY3LCebU+1ICA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Benjamin Gaignard , Tomasz Figa , Hans Verkuil , Sasha Levin Subject: [PATCH 6.8 509/715] media: usbtv: Remove useless locks in usbtv_video_free() Date: Sun, 24 Mar 2024 18:31:28 -0400 Message-ID: <20240324223455.1342824-510-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Benjamin Gaignard [ Upstream commit 65e6a2773d655172143cc0b927cdc89549842895 ] Remove locks calls in usbtv_video_free() because are useless and may led to a deadlock as reported here: https://syzkaller.appspot.com/x/bisect.txt?x=166dc872180000 Also remove usbtv_stop() call since it will be called when unregistering the device. Before 'c838530d230b' this issue would only be noticed if you disconnect while streaming and now it is noticeable even when disconnecting while not streaming. Fixes: c838530d230b ("media: media videobuf2: Be more flexible on the number of queue stored buffers") Fixes: f3d27f34fdd7 ("[media] usbtv: Add driver for Fushicai USBTV007 video frame grabber") Signed-off-by: Benjamin Gaignard Reviewed-by: Tomasz Figa Tested-by: Hans Verkuil Signed-off-by: Hans Verkuil [hverkuil: fix minor spelling mistake in log message] Signed-off-by: Sasha Levin --- drivers/media/usb/usbtv/usbtv-video.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/media/usb/usbtv/usbtv-video.c b/drivers/media/usb/usbtv/usbtv-video.c index 62a583040cd48..702f1c8bd2ab3 100644 --- a/drivers/media/usb/usbtv/usbtv-video.c +++ b/drivers/media/usb/usbtv/usbtv-video.c @@ -963,15 +963,8 @@ int usbtv_video_init(struct usbtv *usbtv) void usbtv_video_free(struct usbtv *usbtv) { - mutex_lock(&usbtv->vb2q_lock); - mutex_lock(&usbtv->v4l2_lock); - - usbtv_stop(usbtv); vb2_video_unregister_device(&usbtv->vdev); v4l2_device_disconnect(&usbtv->v4l2_dev); - mutex_unlock(&usbtv->v4l2_lock); - mutex_unlock(&usbtv->vb2q_lock); - v4l2_device_put(&usbtv->v4l2_dev); } -- 2.43.0