From patchwork Fri Oct 28 11:52:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 17726 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 353CABDB16 for ; Fri, 28 Oct 2022 11:52:09 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C94D862FDE; Fri, 28 Oct 2022 13:52:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1666957928; bh=RdU01E7m/mPlZLCGKkhVgezt0HUMZDaZhZcV/C16tAc=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=EnWrMtLtcKNVA2p9neMtEVT8A8pcXNNkE+bTx0gQ8vt62Ba+q9kWG/PLTJUvjkJwq vMiOT7smsIpbDEmRdFSgDctto6A7z0VjhrceAwXjf+6t1K+1iRXhITvqDJthAHB2y8 nPW0rd2kBLOn735J0xFmiBwXceeFXu7gtbCWBIi0Wc84ogbFh29whZQbpJmstX28Iv wYNdjutahEErdy9XFeqpXhDcFpWfMs379PRpRbjkuMa40Zd9RsiKRwzIoyAHHU7LQN V13L6Tcj6zlUQ6w9rh85WmD88vS0fJh8ysVs/HYa/pE4c71XIRTR5I8eg975yOK8kr 6Zd5cIceHI/Uw== Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 234BB62FD5 for ; Fri, 28 Oct 2022 13:52:06 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="qIZC9NcE"; dkim-atps=neutral Received: by mail-wm1-x334.google.com with SMTP id b20-20020a05600c4e1400b003cc28585e2fso3669369wmq.1 for ; Fri, 28 Oct 2022 04:52:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5AiDnYESq1STHI/2ycKsedI2/UnLEEdz3AN1E5rBL5E=; b=qIZC9NcEfk0IxGRJAziXtl6lmOtPfX5TXPm11kQ9NVoMGYuXSZCJ9uSZ2jr+Go09MP yFkHiTXiqRss3CpFRIBSr1Hed+LnATQ+A6z6j2K6QZf1nGFU7Mhwaf5BlR0mwlF9BF/W TXmCbh/akbJyfxGBtsFGEDNjDpqksy95+qqqrTIBRnAXKF2MzwqWD+oP8hn2G4L4F1Yy nN9xclZXv1motUHMYALb/6bdfAe5IGhzjgNJmEG+NPk9zhFgCU1aZguYmSSe7KOdLvHo A2wNg4DNGHfj7+URG84vfW48oQVntG9xleczBUUib6x5eioi7q53I7IdZS2VeLMvGhfu yxMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5AiDnYESq1STHI/2ycKsedI2/UnLEEdz3AN1E5rBL5E=; b=PEJkRkfgFI5BNQcrb7bynO0B1Dne+Xwdg/+0syeHGzgLL6EnC+2+jEI7GaSe63hbtW zrwsTeZLLSfM2jlISFma9aJcIF7XZqW2fe2iUNwFO8f4N5xhZOnrjNqYfnoLVdBgRWoH ufYzxlbi6h7KfYybRxrHEKNMJBS9Mbqi40W8sGW2eY2ugIMW48Znkhn5lHy2IC4PiXEk kTHlRqQ/Qh05Oj4tX4c7nTE2s8h61OA/DYBMhm8JELTSjpY8y/uNpEad7WzVVpMnXfbf Xh2zs0vYyaIVG4B4RR1GgSux7tPJ89RXPyNpgb2cyPIzZ/OiKS3wUUhpNxzsOGXirQBu YHOw== X-Gm-Message-State: ACrzQf2/anQheStILBoibR0rRA6flpUZUETbZhlDanz2GsWgwCCPdgc1 JXmBCXKNnccUKwJsU8QlHlFz2tacyE9uXw== X-Google-Smtp-Source: AMsMyM64n8mWu9XaF0LfVVmh7PGFfOZmAY+iEojqQ0+HTRxKNgLLzDxTaYV956+m3ib8H9xeau7HMg== X-Received: by 2002:a05:600c:35cb:b0:3c6:e382:62fb with SMTP id r11-20020a05600c35cb00b003c6e38262fbmr8991671wmq.22.1666957925345; Fri, 28 Oct 2022 04:52:05 -0700 (PDT) Received: from naush-laptop.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id a5-20020adffb85000000b002366fb99cdasm3441686wrr.50.2022.10.28.04.52.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Oct 2022 04:52:04 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Fri, 28 Oct 2022 12:52:00 +0100 Message-Id: <20221028115200.8138-3-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221028115200.8138-1-naush@raspberrypi.com> References: <20221028115200.8138-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v1 2/2] pipeline: raspberrypi: Do not unconditionally free buffers on close X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Naushir Patuck via libcamera-devel From: Naushir Patuck Reply-To: Naushir Patuck Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" When a camera is terminated, do not unconditionally free buffers in the RPiCameraData destructor. Otherwise, this causes harmless error log messages to be displayed if no buffer have previously been allocated. Signed-off-by: Naushir Patuck Tested-by: David Plowman Reviewed-by: David Plowman Reviewed-by: Kieran Bingham --- src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index 343f8cb2c7ed..31107e1338bf 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -191,7 +191,8 @@ public: ~RPiCameraData() { - freeBuffers(); + if (buffersAllocated_) + freeBuffers(); } void freeBuffers();