author | baocheng.sun <baocheng.sun@amlogic.com> | 2014-11-12 06:48:24 (GMT) |
---|---|---|
committer | baocheng.sun <baocheng.sun@amlogic.com> | 2014-11-12 06:54:40 (GMT) |
commit | dbae29238ba9a582281cdb172995db7576b79ceb (patch) | |
tree | 70924a700b3ab3a7580c1489a7305e5b05e3e511 | |
parent | a4a45f7f4238938be19604f8114c11008dd31fcb (diff) | |
download | power-dbae29238ba9a582281cdb172995db7576b79ceb.zip power-dbae29238ba9a582281cdb172995db7576b79ceb.tar.gz power-dbae29238ba9a582281cdb172995db7576b79ceb.tar.bz2 |
pd#99357: change initialization value of fd to an invalid value -1
-rwxr-xr-x | power.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -47,7 +47,7 @@ static void power_hint(struct power_module *module, power_hint_t hint, const char *val = "preheat"; static int bytes = 7; - if (pm->fp == 0) { + if (pm->fp == -1) { pm->fp = open("/sys/class/mpgpu/mpgpucmd", O_RDWR, 0644); if (DEBUG) { ALOGD("open file /sys/class/mpgpu/mpgpucmd,fd is %d", pm->fp); @@ -56,7 +56,7 @@ static void power_hint(struct power_module *module, power_hint_t hint, switch (hint) { case POWER_HINT_INTERACTION: - if (pm->fp > 0) { + if (pm->fp >= 0) { int len = write(pm->fp, val, bytes); if (DEBUG) { ALOGD("%s: write sucessfull, fd is %d\n", __FUNCTION__, pm->fp); @@ -91,5 +91,5 @@ struct private_power_module HAL_MODULE_INFO_SYM = { .setInteractive = power_set_interactive, .powerHint = power_hint, }, - .fp = 0, + .fp = -1, }; |