Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp468277pxb; Thu, 14 Jan 2021 10:08:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJzZ8nsh3Mdi6kKnYT6SYB0DsLl/G0tbBTPmkTMy0r/RoKXJPwqIEwqL9oWyC4/UtvwtaEAS X-Received: by 2002:a50:fe0e:: with SMTP id f14mr6856925edt.159.1610647735880; Thu, 14 Jan 2021 10:08:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610647735; cv=none; d=google.com; s=arc-20160816; b=oRgSP/hAZg/2OTTnS9fl+FlGEDWxSNGm6FXWmatcyv4hL2j9XJukxef8ELH2UznDIM L8M2+VxFaPnyxv1H3RCh+LWJnxypitVxeLqaKcD/F7ef74GlK8vtKW7T5OPfPiTd7VDZ GaVKjmWRtiWOnPwOfGqcEQHlBKeJdRuAVlQeJBmnqxvDCBFBZeqkCF6f9ZAP1jAph0/A 3UbIutHlD04C2RPYpQ/dyH33vPe7Guaeo+3vPi1l04EIDoFlL0PjAgqoQvCDnUtwN5h5 WoIQAYRm9MuI5jQJS623CX+BUR60yshBd/4HB8mOR00lHEzxqsDduOuWk2JJFDmyEt0Z 2Lqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=3CwTvcG7ePV+lYYJOB9OZfFKhwohn9kyZOfgK9wpVyo=; b=bwaVWJiV6wJ6uO+cNZ+mMzOAp8S6gmCJEbWOMQFQCWwSAc3U/qMuRogtwk+zVrpabR PD6CHRwMj+pzti9TWPCVeemULnFyrm1LwelYk8em+RZG5Oexcye+hZxQoGRx2CFJfviM 1aaraNViU3/qnEisYU00e29OL5WMMieAu24lonUwvMOQ+kqzI8X9nNXIta9yAXGD7JLz op856CTq83g0gSklK6D1/Qwq4j3OjE9NEPPmTAM2A1xWkuwdXKvn3ZPpQon43vATOXUh wcGpyyfLYXFPx0ppKcx2X7dFZ2EU3wi9YRBVPH13298FgRY9pFsPER1A1CydRZxJYNn/ 9xMg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x11si2644283ejb.241.2021.01.14.10.08.30; Thu, 14 Jan 2021 10:08:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729493AbhANSGH (ORCPT + 99 others); Thu, 14 Jan 2021 13:06:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726743AbhANSFy (ORCPT ); Thu, 14 Jan 2021 13:05:54 -0500 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14779C061786; Thu, 14 Jan 2021 10:05:12 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: koike) with ESMTPSA id 192A41F45C75 From: Helen Koike To: linux-media@vger.kernel.org Cc: hverkuil@xs4all.nl, mchehab@kernel.org, hans.verkuil@cisco.com, kernel@collabora.com, linux-kernel@vger.kernel.org, tfiga@chromium.org Subject: [PATCH 3/3] media: videobuf2-v4l2: remove redundant error test Date: Thu, 14 Jan 2021 15:01:49 -0300 Message-Id: <20210114180149.1755892-4-helen.koike@collabora.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210114180149.1755892-1-helen.koike@collabora.com> References: <20210114180149.1755892-1-helen.koike@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org request_fd is validated under media_request_get_by_fd() just below this check. Thus remove it. Suggested-by: Tomasz Figa Signed-off-by: Helen Koike --- drivers/media/common/videobuf2/videobuf2-v4l2.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/media/common/videobuf2/videobuf2-v4l2.c b/drivers/media/common/videobuf2/videobuf2-v4l2.c index 96d3b2b2aa31..bb642c0775d1 100644 --- a/drivers/media/common/videobuf2/videobuf2-v4l2.c +++ b/drivers/media/common/videobuf2/videobuf2-v4l2.c @@ -488,11 +488,6 @@ static int vb2_queue_or_prepare_buf(struct vb2_queue *q, struct media_device *md !q->ops->buf_out_validate)) return -EINVAL; - if (b->request_fd < 0) { - dprintk(q, 1, "%s: request_fd < 0\n", opname); - return -EINVAL; - } - req = media_request_get_by_fd(mdev, b->request_fd); if (IS_ERR(req)) { dprintk(q, 1, "%s: invalid request_fd\n", opname); -- 2.29.2