ipa: vimc: Validate configuration file in init()
Make sure we can open the configuration file passed to the init() function, and return an error otherwise. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
parent
32df46f0b6
commit
8a9be175a7
1 changed files with 10 additions and 1 deletions
|
@ -19,6 +19,7 @@
|
|||
|
||||
#include <libipa/ipa_interface_wrapper.h>
|
||||
|
||||
#include "file.h"
|
||||
#include "log.h"
|
||||
|
||||
namespace libcamera {
|
||||
|
@ -65,7 +66,15 @@ int IPAVimc::init(const IPASettings &settings)
|
|||
{
|
||||
trace(IPAOperationInit);
|
||||
|
||||
LOG(IPAVimc, Debug) << "initializing vimc IPA!";
|
||||
LOG(IPAVimc, Debug)
|
||||
<< "initializing vimc IPA with configuration file "
|
||||
<< settings.configurationFile;
|
||||
|
||||
File conf(settings.configurationFile);
|
||||
if (!conf.open(File::ReadOnly)) {
|
||||
LOG(IPAVimc, Error) << "Failed to open configuration file";
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue