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

paul.elder at ideasonboard.com paul.elder at ideasonboard.com
Wed Aug 4 13:26:46 CEST 2021


Hi Kieran,

On Wed, Aug 04, 2021 at 11:21:56AM +0100, Kieran Bingham wrote:
> 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

Ooh that's a lot of coverity fixes \o/

> Fixes: 7832e19a599e ("utils: ipc: add templates for code generation for IPC mechanism")
> Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>

Reviewed-by: Paul Elder <paul.elder 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