lowmem: Add MEM_LEVEL_LOW in lowmem_register_mem_level_controller() 31/291331/2
authorUnsung Lee <unsung.lee@samsung.com>
Thu, 13 Apr 2023 11:27:06 +0000 (20:27 +0900)
committerUnsung Lee <unsung.lee@samsung.com>
Mon, 17 Apr 2023 02:19:24 +0000 (11:19 +0900)
MEM_LEVEL_LOW is missing in lowmem_register_mem_level_controller(),
so currently controller of MEM_LEVEL_LOW is always NULL.
It causes SIGABRT when memory level is MEM_LEVEL_LOW.
To fix the problem, add MEM_LEVEL_LOW in lowmem_register_mem_level_controller()

Change-Id: I2bec09b0944f9f0b33c8fa5487b7204a6fc1a305
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
src/resource-limiter/memory/lowmem.c

index bab51ab..f8f41eb 100644 (file)
@@ -276,6 +276,7 @@ void lowmem_register_mem_level_controller(int mem_state, int (*controller)(void
        switch (mem_state) {
        case MEM_LEVEL_HIGH:
        case MEM_LEVEL_MEDIUM:
+       case MEM_LEVEL_LOW:
        case MEM_LEVEL_CRITICAL:
        case MEM_LEVEL_OOM:
                mem_level_ops_list[mem_state].controller = controller;