Coverity issue: 328528
Fixes:
e6c6dc0f96c8 ("power: add p-state driver compatibility")
Signed-off-by: Liang Ma <liang.j.ma@intel.com>
Reviewed-by: Lei Yao <lei.a.yao@intel.com>
Tested-by: Lei Yao <lei.a.yao@intel.com>
Signed-off-by: David Hunt <david.hunt@intel.com>
pi->lcore_id);
f_max = fopen(fullpath_max, "rw+");
+ if (f_max == NULL)
+ fclose(f_min);
+
FOPEN_OR_ERR_RET(f_max, -1);
pi->f_cur_min = f_min;
FOPEN_OR_ERR_RET(f_min, ret);
f_max = fopen(fullpath_max, "r");
+ if (f_max == NULL)
+ fclose(f_min);
+
FOPEN_OR_ERR_RET(f_max, ret);
s_min = fgets(buf_min, sizeof(buf_min), f_min);