summaryrefslogtreecommitdiff
path: root/src/device_manager_plugin_pinetrail.c
diff options
context:
space:
mode:
authorMyungJoo Ham <myungjoo.ham@samsung.com>2013-04-22 18:02:55 +0900
committerjy910.yun <jy910.yun@samsung.com>2013-06-27 14:17:57 +0900
commit629a28dde90c0a7af08b5fe3f1694387f0bb0e0a (patch)
tree4e783e85515ac35f94afbfb3a88cf343ba440ebe /src/device_manager_plugin_pinetrail.c
parent915b1cd09ca95f0cce65344819e98dff11647034 (diff)
downloaddevice-manager-plugin-pinetrail-2.2_release.tar.gz
device-manager-plugin-pinetrail-2.2_release.tar.bz2
device-manager-plugin-pinetrail-2.2_release.zip
There is a possibility that the function may incur divide-by-zero error with charge_full == 0. And other case of prevent issue also resolved regarding uncheck the return value or error handling Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> Change-Id: I33ae5ca032927869905dee4ad7266d81e480decb
Diffstat (limited to 'src/device_manager_plugin_pinetrail.c')
-rw-r--r--src/device_manager_plugin_pinetrail.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/device_manager_plugin_pinetrail.c b/src/device_manager_plugin_pinetrail.c
index 70214d8..9030981 100644
--- a/src/device_manager_plugin_pinetrail.c
+++ b/src/device_manager_plugin_pinetrail.c
@@ -704,7 +704,7 @@ int OEM_sys_get_battery_capacity(int *value)
if(charge_full == 0)
{
ret = sys_get_int(BATTERY_CHARGE_FULL_PATH, &charge_full);
- if(ret != 0)
+ if(ret != 0 || charge_full == 0)
{
devmgr_log("get battery charge full error!");
charge_full = 0;