aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTuukka Tikkanen <tuukka.tikkanen@linaro.org>2015-01-13 19:51:43 +0200
committerTuukka Tikkanen <tuukka.tikkanen@linaro.org>2015-01-13 19:51:43 +0200
commite776936ab69d309084e464e0c8dfccb822ba500a (patch)
tree50101012efe3e30516740bff792ded13c378c959
parentb67b73da9fa327f25a7855a2773afa74e8870255 (diff)
Energy model: Check for error from idlestat_load correctly
Idlestat_load() returns ptr_error() rather than a NULL pointer in case of failure. The function make_energy_model_template checked for NULL instead of using the is_err() macro. This patch corrects the behavior. Signed-off-by: Tuukka Tikkanen <tuukka.tikkanen@linaro.org>
-rw-r--r--energy_model.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/energy_model.c b/energy_model.c
index 23463df..7a0ba8a 100644
--- a/energy_model.c
+++ b/energy_model.c
@@ -60,7 +60,7 @@ static int make_energy_model_template(struct program_options *options)
fprintf(f, "# Replace ? with correct values\n");
datas = idlestat_load(options->filename);
- if (!datas) {
+ if (is_err(datas)) {
fclose(f);
unlink(options->energy_model_filename);
return -1;