From 1e1da81a2733122ae0900c5f701e971e5fc161de Mon Sep 17 00:00:00 2001 From: Roman Kiryanov Date: Thu, 10 May 2018 10:52:53 -0700 Subject: [PATCH] Revert "goldfish: pipe: ANDROID: Allocate memory with GFP_KERNEL." This reverts commit ed11d8f2a0d07756acace1a2a295f29e41976358. Since get_free_pipe_id_locked runs with interrupts disabled, we don't want to make calls that could lead to sleep. Bug: 72717639 Bug: 66884503 Signed-off-by: Roman Kiryanov Change-Id: I6c2eac97fd415bdbd5afa0a3a90559e0da3e1c86 --- drivers/platform/goldfish/goldfish_pipe_v2.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/platform/goldfish/goldfish_pipe_v2.c b/drivers/platform/goldfish/goldfish_pipe_v2.c index 28ac0b146e45..3582fd68ffc2 100644 --- a/drivers/platform/goldfish/goldfish_pipe_v2.c +++ b/drivers/platform/goldfish/goldfish_pipe_v2.c @@ -697,11 +697,14 @@ static int get_free_pipe_id_locked(struct goldfish_pipe_dev *dev) return id; { - /* Reallocate the array */ + /* Reallocate the array. + * Since get_free_pipe_id_locked runs with interrupts disabled, + * we don't want to make calls that could lead to sleep. + */ u32 new_capacity = 2 * dev->pipes_capacity; struct goldfish_pipe **pipes = kcalloc(new_capacity, sizeof(*pipes), - GFP_KERNEL); + GFP_ATOMIC); if (!pipes) return -ENOMEM; memcpy(pipes, dev->pipes, sizeof(*pipes) * dev->pipes_capacity);