[{"id":5365,"web_url":"https://patchwork.libcamera.org/comment/5365/","msgid":"<20200623231056.GO5870@pendragon.ideasonboard.com>","date":"2020-06-23T23:10:56","subject":"Re: [libcamera-devel] [PATCH v3 20/22] v4l2: v4l2_camera_proxy:\n\tDon't allow buffers to be freed if still mmaped","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Paul,\n\nThank you for the patch.\n\nOn Wed, Jun 24, 2020 at 04:08:34AM +0900, Paul Elder wrote:\n> In VIDIOC_REQBUFS with count = 0, if the buffers are still mmaped, they\n> should not be allowed to be freed. Add a check for this.\n> \n> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>\n> \n> ---\n> No change in v3\n> \n> New 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(+)\n> \n> diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp\n> index dd09951..ce0d755 100644\n> --- a/src/v4l2/v4l2_camera_proxy.cpp\n> +++ b/src/v4l2/v4l2_camera_proxy.cpp\n> @@ -471,6 +471,9 @@ int V4L2CameraProxy::vidioc_reqbufs(V4L2CameraFile *file, struct v4l2_requestbuf\n>  \tmemset(arg->reserved, 0, sizeof(arg->reserved));\n>  \n>  \tif (arg->count == 0) {\n\nIf we decide not to support buffer orphaning, despite reporting a v5.2.0\nversion, we should at least have\n\n\t\t/** \\todo Add buffer orphaning support */\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> +\t\tif (!mmaps_.empty())\n> +\t\t\treturn -EBUSY;\n> +\n>  \t\tif (vcam_->isRunning())\n>  \t\t\treturn -EBUSY;\n>","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 33A48603B9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 24 Jun 2020 01:11:24 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 99D5F2A9;\n\tWed, 24 Jun 2020 01:11:23 +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=\"L5rUGqPG\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1592953883;\n\tbh=pDQpBnAuTKRWSHdAGsW8hj6jH05K5CghOdolkyhFF1g=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=L5rUGqPGTTCHXh8i+M6922N6JroEQw1mVDbXA+/LfMPjJcckbs8a8DxEzJa3biGkD\n\tb96QdKhx+aY7ZYiw5UA4MUksbZF6D3Dhf5CzabNrsEhEVizsU2F7QGYaLiRnp2KOKO\n\t0fGMdBd3YbdWzp5/NCOkq2mrH34Rghr+7BIqJVKY=","Date":"Wed, 24 Jun 2020 02:10:56 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Paul Elder <paul.elder@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20200623231056.GO5870@pendragon.ideasonboard.com>","References":"<20200623190836.53446-1-paul.elder@ideasonboard.com>\n\t<20200623190836.53446-21-paul.elder@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20200623190836.53446-21-paul.elder@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v3 20/22] v4l2: v4l2_camera_proxy:\n\tDon't allow buffers to be freed if still mmaped","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":"Tue, 23 Jun 2020 23:11:24 -0000"}}]