diff options
author | Tuukka Tikkanen <tuukka.tikkanen@linaro.org> | 2015-01-13 19:51:43 +0200 |
---|---|---|
committer | Tuukka Tikkanen <tuukka.tikkanen@linaro.org> | 2015-01-13 19:51:43 +0200 |
commit | e776936ab69d309084e464e0c8dfccb822ba500a (patch) | |
tree | 50101012efe3e30516740bff792ded13c378c959 | |
parent | b67b73da9fa327f25a7855a2773afa74e8870255 (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.c | 2 |
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; |