소스 검색

qcacmn: fix GFP flag for memory allocation

As per implementation of might_sleep(), rcu_read_lock()
nesting depth should be taken into consideration too to
figure out whether sleeping is allowable or not.
To make align with it, allocate memory with GFP_ATOMIC
if rcu_read_lock() nesting depth is not zero.

Change-Id: I83c042827db4024cedf4f043a4243e399a33f6e5
CRs-Fixed: 3272683
Yu Wang 2 년 전
부모
커밋
c520d7fe83
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      qdf/linux/src/qdf_mem.c

+ 1 - 1
qdf/linux/src/qdf_mem.c

@@ -510,7 +510,7 @@ qdf_export_symbol(prealloc_disabled);
 
 int qdf_mem_malloc_flags(void)
 {
-	if (in_interrupt() || irqs_disabled() || in_atomic())
+	if (in_interrupt() || !preemptible() || rcu_preempt_depth())
 		return GFP_ATOMIC;
 
 	return GFP_KERNEL;