Revert "util: kernel: Fix overflow issue when multiply operation" 12/272712/1
authorChanwoo Choi <cw00.choi@samsung.com>
Wed, 23 Mar 2022 04:54:39 +0000 (13:54 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Wed, 23 Mar 2022 05:00:07 +0000 (14:00 +0900)
This reverts commit 8c98239629e4b49f934de535f881bff26cc52ae9.

Change-Id: I1757a90f63ed45ed6ee1c987f9bc7eb45b4e68fb
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
src/util/kernel.c

index a0f267c..bd797fc 100644 (file)
@@ -184,7 +184,7 @@ int kernel_get_memory_info(const char *key, u_int64_t *val)
                if (!strncmp(buf, key, strlen(key))) {
                        sscanf(buf, "%*s %"PRIu64, val);
                        if (strstr(buf, "kB"))
-                               *val = (u_int64_t)(*val * 1024);
+                               *val *= 1024;
                        break;
                }
        }