@@ -593,8 +593,10 @@ int display_register(int win, struct display_ops *ops)
{
size_t array_size = sizeof(windata) / sizeof(windata[0]);
- if (win < 0 || win >= array_size)
+ if (win < 0 || win >= array_size) {
+ printf("error: invalid window");
return -1;
+ }
windata[win].ops = ops;
@@ -243,7 +243,7 @@ int main(int argc, char **argv)
}
if (regulator_init()) {
- printf("not enough memory to allocate regulators info\n");
+ printf("failed to initialize regulator\n");
options->regulators = false;
}
@@ -218,8 +218,10 @@ static int fill_regulator_cb(struct tree *t, void *data)
struct regulator_info *reg;
reg = regulator_alloc();
- if (!reg)
+ if (!reg) {
+ printf("error: unable to allocate memory for regulator\n");
return -1;
+ }
t->private = reg;
/* we skip the root node but we set it expanded for its children */
@@ -121,8 +121,10 @@ static int tree_scan(struct tree *tree, tree_filter_t filter, bool follow)
int ret = 0;
dir = opendir(tree->path);
- if (!dir)
+ if (!dir) {
+ printf("error: unable to open directory %s\n", tree->path);
return -1;
+ }
while (!readdir_r(dir, &dirent, &direntp)) {
- bug : https://bugs.launchpad.net/linaro-powerdebug/+bug/1014667 Signed-off-by: Sanjay Singh Rawat <sanjay.rawat@linaro.org> --- display.c | 4 +++- powerdebug.c | 2 +- regulator.c | 4 +++- tree.c | 4 +++- 4 files changed, 10 insertions(+), 4 deletions(-)