From patchwork Tue Jul 22 08:34:41 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 23894 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 5CDB0C3237 for ; Tue, 22 Jul 2025 08:34:47 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3F5776901E; Tue, 22 Jul 2025 10:34:46 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="R9Mmyvyx"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B920668FAC for ; Tue, 22 Jul 2025 10:34:44 +0200 (CEST) Received: from pb-laptop.local (185.221.140.39.nat.pool.zt.hu [185.221.140.39]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 11FDE79CC for ; Tue, 22 Jul 2025 10:34:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1753173247; bh=krKfc960Wd+diumkNR5KYOjW+LnGBBcXBJwp7uVlfII=; h=From:To:Subject:Date:From; b=R9MmyvyxaaFuexrdU+Sl7FeZRZNOqurWP+yOxpZypmjbcfmXCt4A8YpzAZXIk+P36 FaySmK1VqPoAobC+ufj2h3sW9z+BKGebZPcvuARcT0CEzv1riuyxUg9zwMn0tKtl7o bzd/imkbepJKF7Fp4TdLex/z5kSukr1Swc7GqIGg= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [PATCH v1] utils: codegen: proxy: Check `ipc_` instead of `isolate_` Date: Tue, 22 Jul 2025 10:34:41 +0200 Message-ID: <20250722083441.1716976-1-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.50.1 MIME-Version: 1.0 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" Only try to send the "Exit" message if the `IPCPipeUnixSocket` object exists. If the constructor fails, then `ipc_` might not be initialized, which would lead to a nullptr dereference. This can still result in an `ipc_->sendAsync()` call even if `ipc_` is unconnected, but that only reports an error, and is still better than the status quo. Bug: https://bugs.libcamera.org/show_bug.cgi?id=276 Signed-off-by: Barnabás Pőcze --- .../generators/libcamera_templates/module_ipa_proxy.cpp.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl b/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl index 9a3aadbd2..ba740a0de 100644 --- a/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl +++ b/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl @@ -96,7 +96,7 @@ namespace {{ns}} { {{proxy_name}}::~{{proxy_name}}() { - if (isolate_) { + if (ipc_) { IPCMessage::Header header = { static_cast({{cmd_enum_name}}::Exit), seq_++ }; IPCMessage msg(header);