{"id":8417,"url":"https://patchwork.libcamera.org/api/1.1/patches/8417/?format=json","web_url":"https://patchwork.libcamera.org/patch/8417/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20200624145256.48266-20-paul.elder@ideasonboard.com>","date":"2020-06-24T14:52:53","name":"[libcamera-devel,v4,19/22] v4l2: v4l2_camera_proxy: Don't allow streamon if no buffers have been requested","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"b3a2e0ef86333d936e7c66dc8e9d1b11e25f2a3c","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/1.1/people/17/?format=json","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/8417/mbox/","series":[{"id":1041,"url":"https://patchwork.libcamera.org/api/1.1/series/1041/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1041","date":"2020-06-24T14:52:34","name":"Support v4l2-compliance","version":4,"mbox":"https://patchwork.libcamera.org/series/1041/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/8417/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/8417/checks/","tags":{},"headers":{"Return-Path":"<paul.elder@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 269D0609C5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 24 Jun 2020 16:54:01 +0200 (CEST)","from jade.rasen.tech (unknown\n\t[IPv6:2400:4051:61:600:8147:f2a2:a8c6:9087])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 65C58595;\n\tWed, 24 Jun 2020 16:53:59 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"fx0I5zHX\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1593010440;\n\tbh=bYTIsuiQa6XLouqxrGYy1X+Cg77rT/kmgAUs+8UbaIc=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=fx0I5zHX1jxgyPvxpKIx4zXbUabecmabMPw5YA9tBjuXdfMzFB5apeKl2MJlJ4uMk\n\tzdKF645GvxywIU9fOvZFQxsrmGPbFYw8SpRlkc8DLiWAMpdH4wGacBZaCFPt5Rq359\n\tw6UkUfBVYa2RKTOIBFWU3eJ8RHB9zs0t88zXrsTA=","From":"Paul Elder <paul.elder@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Wed, 24 Jun 2020 23:52:53 +0900","Message-Id":"<20200624145256.48266-20-paul.elder@ideasonboard.com>","X-Mailer":"git-send-email 2.27.0","In-Reply-To":"<20200624145256.48266-1-paul.elder@ideasonboard.com>","References":"<20200624145256.48266-1-paul.elder@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v4 19/22] v4l2: v4l2_camera_proxy: Don't\n\tallow streamon if no buffers have been requested","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Wed, 24 Jun 2020 14:54:01 -0000"},"content":"Make VIDIOC_STREAMON return -EINVAL if no buffers have been allocated\nwith reqbufs.\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n---\nNo change in v4\n\nNo change in v3\n\nNew in v2\n- split from \"Fix v4l2-compliance streaming tests\"\n---\n src/v4l2/v4l2_camera_proxy.cpp | 3 +++\n 1 file changed, 3 insertions(+)","diff":"diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp\nindex 2aff53e..2dbeef3 100644\n--- a/src/v4l2/v4l2_camera_proxy.cpp\n+++ b/src/v4l2/v4l2_camera_proxy.cpp\n@@ -632,6 +632,9 @@ int V4L2CameraProxy::vidioc_streamon(V4L2CameraFile *file, int *arg)\n {\n \tLOG(V4L2Compat, Debug) << \"Servicing vidioc_streamon fd = \" << file->efd();\n \n+\tif (bufferCount_ == 0)\n+\t\treturn -EINVAL;\n+\n \tif (!validateBufferType(*arg))\n \t\treturn -EINVAL;\n \n","prefixes":["libcamera-devel","v4","19/22"]}