From patchwork Tue Jul 20 10:28:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 13060 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 8D43DC322B for ; Tue, 20 Jul 2021 10:29:05 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 96CF068546; Tue, 20 Jul 2021 12:29:04 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="OWYDDxTc"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A13436853F for ; Tue, 20 Jul 2021 12:29:03 +0200 (CEST) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C52AF443; Tue, 20 Jul 2021 12:29:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1626776943; bh=wq1UefxZgfJgrVBj+J6uuS9slpCYoK6HfJFhoZVHJa0=; h=From:To:Cc:Subject:Date:From; b=OWYDDxTcM/IdJhRfKvyfxfNy73bfv0O8aeBLzOB7/vYL9kSJLN3wa8hiEusP+d5Wp jt+6qqT6XPgFaSUeimRra+R8hJ0ZBuTXX2DbQE2trz3gxhZGiMJE5DczqhW5dfEGTc Knikr7WIPWQABoy5G0P0IOXlVnDlaJX/lGBPiWD0= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Tue, 20 Jul 2021 19:28:53 +0900 Message-Id: <20210720102853.28541-1-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH] ipa: IPADataSerializer: Fix FileDescriptor deserialization 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Previously deserializing a FileDescriptor would use the copy constructor, causing an fd leak. Fix this by copying the fd integer to force the FileDescriptor to use the move constructor. Signed-off-by: Paul Elder --- Umang, could you please check if this fixes the issue? I'll remove the error message; it's just there for debugging (or we can keep it to protect against unforseen errors?) --- src/libcamera/ipa_data_serializer.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/libcamera/ipa_data_serializer.cpp b/src/libcamera/ipa_data_serializer.cpp index fb941e6b..2a527d5d 100644 --- a/src/libcamera/ipa_data_serializer.cpp +++ b/src/libcamera/ipa_data_serializer.cpp @@ -8,6 +8,7 @@ #include "libcamera/internal/ipa_data_serializer.h" #include +#include /** * \file ipa_data_serializer.h @@ -547,7 +548,14 @@ FileDescriptor IPADataSerializer::deserialize(std::vector