{"id":17728,"url":"https://patchwork.libcamera.org/api/1.1/patches/17728/?format=json","web_url":"https://patchwork.libcamera.org/patch/17728/","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":"<20221028135110.13433-1-naush@raspberrypi.com>","date":"2022-10-28T13:51:10","name":"[libcamera-devel] pipeline: raspberrypi: Do not unconditionally free buffers on close","commit_ref":"30d704732badc675f72fe73d14749669cb645c23","pull_url":null,"state":"accepted","archived":false,"hash":"d5b8521c24257cee5e847bcf12558b7b8f9e7f64","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/1.1/people/34/?format=json","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/17728/mbox/","series":[{"id":3587,"url":"https://patchwork.libcamera.org/api/1.1/series/3587/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3587","date":"2022-10-28T13:51:10","name":"[libcamera-devel] pipeline: raspberrypi: Do not unconditionally free buffers on close","version":1,"mbox":"https://patchwork.libcamera.org/series/3587/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/17728/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/17728/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 24DA7BDB16\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 28 Oct 2022 13:51:15 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7E93562FEC;\n\tFri, 28 Oct 2022 15:51:14 +0200 (CEST)","from mail-wm1-x334.google.com (mail-wm1-x334.google.com\n\t[IPv6:2a00:1450:4864:20::334])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0783561F4A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 28 Oct 2022 15:51:13 +0200 (CEST)","by mail-wm1-x334.google.com with SMTP id\n\tm29-20020a05600c3b1d00b003c6bf423c71so6677254wms.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 28 Oct 2022 06:51:13 -0700 (PDT)","from naush-laptop.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\tm8-20020a05600c3b0800b003c6edc05159sm7291082wms.1.2022.10.28.06.51.11\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 28 Oct 2022 06:51:12 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1666965074;\n\tbh=EpxW1eCv4PqGTgyBl7RrkoBtCaejCL5796aam+eMmtA=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=WTB6aADnfnT7cGyRqUVefXxlreuo+Pktixft9m78y68eRG1sYwfOu5OGIIuaCO/PG\n\tlcScW45UtYD2W89tp+pvFFSdQgAUpw2MHZVlNk7heVrFMb/dkhf0C//GXm6DIfrFx3\n\ti+ZMnJQNljccJX59GRy2et/9q6FSzOAQGkRywyKjFLy7P6bC8zW0DnzsPB8FzjZfpg\n\tEQsDSLT+/4xvtv1j29G7kj32oCwOoDM47D2rUyQkP7rnYArT4u/nxsvdJaJAHeS702\n\tbGPOe2l+XRUBh6aU52DMer4ZEo2T3zwpoYTCBV1NZHajAUAuuBXK4BgX5lELyzMQDV\n\twjECLY2Pb64ng==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=pJZCtAFPEqGnKFw45EueE5fi2brF74zHRaK+U70buTk=;\n\tb=cSDcaX0HnH63clwWmkU9WhjGQtEcZ2XB/4hNQ4gff7UQSmBSxTcbM7kTmWo2XG0oHk\n\tEpysqtb4oyiQijNnoiZKky3yrlAEkLcJuxNMo4X0BDZfxGxKCL41UY/q+GiMYurbymVm\n\tevyHvvB2zUEssB+HeMKWS4/GPJwX7TND7CwEsVWIVIqvhIitfqWKxVlWndl9N+DpLJxq\n\tp5KnY7ddWbhhwS/Q6mZD3caS73Cosn6Uq5pp9kauJBTCymzYnnvLOx/cox40Ao8Uqg30\n\t+Dt7OOc3oK5tuwR/Fs0k8F3UIYA/x8XjpeJlyglSGGefJ8MOX8e8yUMx+xwGKydigIyc\n\timxQ=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"cSDcaX0H\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=pJZCtAFPEqGnKFw45EueE5fi2brF74zHRaK+U70buTk=;\n\tb=d5BkRHNSmhLWoD6gFGuTYZrmYAdPgO5Wvh0WwtekV3b1WHsJL5ZmhJctQDeP2quyRG\n\t0spr8de82KeX0/gPxRRcfz0VaDvrhPQ2DGrbWP0Z0tLwrt0/EZxl3TBGOEZ/9okdr+No\n\thZNgCUf9cLS0kEJ2O9JSmuJgCAc01q2lU/aLYMj0JZRE59BEkj8ZS7vNk0W20vQM8D8O\n\t+HAjLAwa2yTw6klwRNnlhSnzdnV3nTwnZUyqQf9l0FmGiedhFVpQowfw83mPhZ5WaTE/\n\tidfkHOORXRTcaCrWzNFH93XXO9PLP2WplOozM4BAXzabQAV7bWMEHMKSocY22CaFpJfx\n\tCO3A==","X-Gm-Message-State":"ACrzQf331BXVMLMoIV+cIOWAkP9S4WmP8/AgXdoP4tNvLcOipALgBIOB\n\tdT1rEhivssJHSRUwTrnbxlDtjdJ2VguKHA==","X-Google-Smtp-Source":"AMsMyM7hHM7a42n92vUA+KjFNlz/oQaw3cEQQ9K0WqE+ob1S0oeBJttVErUoFVSSUbeCLymLMm3CZQ==","X-Received":"by 2002:a7b:c30c:0:b0:3c6:f26a:590f with SMTP id\n\tk12-20020a7bc30c000000b003c6f26a590fmr9659549wmj.205.1666965072403; \n\tFri, 28 Oct 2022 06:51:12 -0700 (PDT)","To":"libcamera-devel@lists.libcamera.org","Date":"Fri, 28 Oct 2022 14:51:10 +0100","Message-Id":"<20221028135110.13433-1-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.25.1","In-Reply-To":"<20221028115200.8138-3-naush@raspberrypi.com>","References":"<20221028115200.8138-3-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH] pipeline: raspberrypi: Do not\n\tunconditionally free buffers on close","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>","From":"Naushir Patuck via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Naushir Patuck <naush@raspberrypi.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"When a camera is terminated, do not unconditionally free buffers in the\nRPiCameraData destructor. Otherwise, this causes harmless error log messages\nto be displayed if no buffer have previously been allocated.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nTested-by: David Plowman <david.plowman@raspberrypi.com>\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 3 +++\n 1 file changed, 3 insertions(+)","diff":"diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex 343f8cb2c7ed..1b599fcc9ecf 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -1506,6 +1506,9 @@ void PipelineHandlerRPi::mapBuffers(Camera *camera, const RPi::BufferMap &buffer\n \n void RPiCameraData::freeBuffers()\n {\n+\tif (!buffersAllocated_)\n+\t\treturn;\n+\n \tif (ipa_) {\n \t\t/*\n \t\t * Copy the buffer ids from the unordered_set to a vector to\n","prefixes":["libcamera-devel"]}