[libcamera-devel] [PATCH] utils: ipc: Initialise ThreadProxy

Kieran Bingham kieran.bingham at ideasonboard.com
Wed Aug 4 12:21:56 CEST 2021


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")
Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
---
 .../generators/libcamera_templates/module_ipa_proxy.h.tmpl   | 5 +++++
 1 file changed, 5 insertions(+)

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 ae168548492c..c222f5f204df 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;
-- 
2.30.2



More information about the libcamera-devel mailing list