libcamera: ipa_module: prevent uninitialised access

The IPAModule::loadIPAModuleInfo() function includes a *data pointer
which is used as a null-pointer comparison in the error path with a
conditional statement of "if (ret || !data)".

The data variable is not initialised, and a single error path evaluates
this as "if (true || uninitialised)".

Whilst this error path does not incorrectly utilise the uninitialised
data, as the ret evaluates to true already, it does leave a statement
which includes an uninitialised variable.

Help the static analysers by initialising the data variable when it is
defined.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Kieran Bingham
2019-07-18 05:59:22 +01:00
parent 1a6b80e4a0
commit 9ecc60e10c

View File

@@ -291,7 +291,7 @@ int IPAModule::loadIPAModuleInfo()
return ret;
}
void *data;
void *data = nullptr;
size_t dataSize;
void *map;
size_t soSize;