[libcamera-devel] [PATCH] utils: ipc: Initialise ThreadProxy
Kieran Bingham
kieran.bingham at ideasonboard.com
Wed Aug 4 13:30:11 CEST 2021
On 04/08/2021 12:26, paul.elder at ideasonboard.com wrote:
> 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/
One for each proxy that gets constructed ;-)
I made this patch some time ago and saw it in my branch and must have
forgotten to send it out - so here it is ;-)
>
>> 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>
Thanks.
>
>> ---
>> .../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