[FIX] Preload: memory allocation in atomic 68/48068/1
authorAlexander Aksenov <a.aksenov@samsung.com>
Tue, 8 Sep 2015 11:29:16 +0000 (14:29 +0300)
committerAlexander Aksenov <a.aksenov@samsung.com>
Sat, 12 Sep 2015 10:28:52 +0000 (13:28 +0300)
kmalloc(..., GFP_KERNEL) -> kmalloc(..., GFP_ATOMIC)
cause executed in handlers

Change-Id: If89c5807d96fee9137fb8b0919b7ed4428772ab6
Signed-off-by: Alexander Aksenov <a.aksenov@samsung.com>
preload/preload_threads.c

index 20840ac..b8c2b77 100644 (file)
@@ -127,7 +127,7 @@ static inline void __set_slot(struct thread_slot *slot,
 static inline int __add_to_disable_list(struct thread_slot *slot,
                                        unsigned long disable_addr)
 {
-       struct disabled_addr *da = kmalloc(sizeof(*da), GFP_KERNEL);
+       struct disabled_addr *da = kmalloc(sizeof(*da), GFP_ATOMIC);
 
        if (da == NULL)
                return -ENOMEM;
@@ -154,7 +154,7 @@ static inline struct disabled_addr *__find_disabled_addr(struct thread_slot *slo
 /* Adds a new slot */
 static inline struct thread_slot *__grow_slot(void)
 {
-       struct thread_slot *tmp = kmalloc(sizeof(*tmp), GFP_KERNEL);
+       struct thread_slot *tmp = kmalloc(sizeof(*tmp), GFP_ATOMIC);
 
        if (tmp == NULL)
                return NULL;