summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorINSUN PYO <insun.pyo@samsung.com>2019-09-26 11:32:37 +0900
committerINSUN PYO <insun.pyo@samsung.com>2019-09-26 11:32:37 +0900
commit7bf0c58d5875120748b8def662b560d7db5e392d (patch)
treeaf35a024fecb56a3496f540c24778be51a99d61f
parent06929f1517ffe404e0f865d40bbe43704ce90e37 (diff)
downloadresourced-7bf0c58d5875120748b8def662b560d7db5e392d.tar.gz
resourced-7bf0c58d5875120748b8def662b560d7db5e392d.tar.bz2
resourced-7bf0c58d5875120748b8def662b560d7db5e392d.zip
Refactoring error handling
Change-Id: Ia1d1a2eb9c50c3c1e72f86101e2af5119f744ee0
-rw-r--r--src/common/storage-helper.c8
-rw-r--r--src/heart/heart-memory.c5
-rw-r--r--src/memory/vmpressure-lowmem-handler.c1
3 files changed, 5 insertions, 9 deletions
diff --git a/src/common/storage-helper.c b/src/common/storage-helper.c
index fdea05c3..776acfe9 100644
--- a/src/common/storage-helper.c
+++ b/src/common/storage-helper.c
@@ -168,13 +168,11 @@ resourced_ret_c storage_get_size(int type, struct storage_size *size)
_E("Failed to get internal storage size");
goto fail;
}
- goto success;
-fail:
g_slist_free_full(paths, free);
- return RESOURCED_ERROR_FAIL;
+ return RESOURCED_ERROR_NONE;
-success:
+fail:
g_slist_free_full(paths, free);
- return RESOURCED_ERROR_NONE;
+ return RESOURCED_ERROR_FAIL;
}
diff --git a/src/heart/heart-memory.c b/src/heart/heart-memory.c
index 3b7aae20..893266bd 100644
--- a/src/heart/heart-memory.c
+++ b/src/heart/heart-memory.c
@@ -106,9 +106,8 @@ static void heart_memory_free_value(gpointer value)
{
struct heart_memory_table * table = (struct heart_memory_table *)value;
- if (!table)
- return;
- free(table);
+ if (table)
+ free(table);
}
static int heart_memory_read_length(char *buf, int count)
diff --git a/src/memory/vmpressure-lowmem-handler.c b/src/memory/vmpressure-lowmem-handler.c
index 6fa5f71c..64b4c751 100644
--- a/src/memory/vmpressure-lowmem-handler.c
+++ b/src/memory/vmpressure-lowmem-handler.c
@@ -885,7 +885,6 @@ done:
if (status == LOWMEM_RECLAIM_DONE)
request_helper_worker(CLEAR_LOGS, MEMPS_LOG_PATH, clear_logs, NULL);
ctl->status = status;
- return;
}
static void *lowmem_reclaim_worker(void *arg)