From 2c18ebb859f54a5f6e620aebc6f3abf3648b7462 Mon Sep 17 00:00:00 2001
From: Kieran Bingham <kieran.bingham@ideasonboard.com>
Date: Tue, 13 Jul 2021 12:01:31 +0100
Subject: utils: ipc: Initialise ThreadProxy

The ThreadProxy IPA template does not implement a constructor and the
default compiler generated constructor does not initialise the private
ipa_ pointer.

Whilst this should not be expected to be used while uninitialised, it
does get caught by static analysis for every IPA module constructed, so
lets be clean and fix it.

Reported-by: Coverity CID=350116
Reported-by: Coverity CID=350123
Reported-by: Coverity CID=350140
Reported-by: Coverity CID=350147
Fixes: 7832e19a599e ("utils: ipc: add templates for code generation for IPC mechanism")
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 utils/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl | 5 +++++
 1 file changed, 5 insertions(+)

(limited to 'utils/ipc/generators')

diff --git a/utils/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl b/utils/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl
index ae168548..c222f5f2 100644
--- a/utils/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl
+++ b/utils/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl
@@ -72,6 +72,11 @@ private:
 	class ThreadProxy : public Object
 	{
 	public:
+		ThreadProxy()
+			: ipa_(nullptr)
+		{
+		}
+
 		void setIPA({{interface_name}} *ipa)
 		{
 			ipa_ = ipa;
-- 
cgit v1.2.1