From a5a88a8d753da5bad23191bbf53c3adcfc719600 Mon Sep 17 00:00:00 2001 From: Yu Wang Date: Mon, 22 Aug 2022 22:38:30 -0700 Subject: [PATCH] cnss_prealloc: replace in_atomic() with proper API According to kernel comment for in_atomic(), it's incorrect to use it outside core kernel code. To follow this rule, replace (irqs_disabled() || in_atomic()) with (!preemptible()) when getting GFP flags. Change-Id: I7cdb28a7f12ffd60216c7bc1921a277de6113cb5 CRs-Fixed: 3273779 --- cnss_prealloc/cnss_prealloc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cnss_prealloc/cnss_prealloc.c b/cnss_prealloc/cnss_prealloc.c index 74d99f9bf1..5f23d766de 100644 --- a/cnss_prealloc/cnss_prealloc.c +++ b/cnss_prealloc/cnss_prealloc.c @@ -195,8 +195,7 @@ void *wcnss_prealloc_get(size_t size) gfp_t gfp_mask = __GFP_ZERO; int i; - if (in_interrupt() || irqs_disabled() || - in_atomic() || rcu_preempt_depth()) + if (in_interrupt() || !preemptible() || rcu_preempt_depth()) gfp_mask |= GFP_ATOMIC; else gfp_mask |= GFP_KERNEL;