Ver código fonte

qcacmn: Support non atomic skb allocation

Improve reliability of skb allocations from non atomic callers
by letting them sleep.

Change-Id: If5a594519902ebe549fbc1ebd8c0eb97679cdcae
CRs-Fixed: 2127770
Houston Hoffman 7 anos atrás
pai
commit
c6d785d033
1 arquivos alterados com 5 adições e 1 exclusões
  1. 5 1
      qdf/linux/src/qdf_nbuf.c

+ 5 - 1
qdf/linux/src/qdf_nbuf.c

@@ -384,11 +384,15 @@ struct sk_buff *__qdf_nbuf_alloc(qdf_device_t osdev, size_t size, int reserve,
 {
 	struct sk_buff *skb;
 	unsigned long offset;
+	int flags = GFP_KERNEL;
 
 	if (align)
 		size += (align - 1);
 
-	skb = dev_alloc_skb(size);
+	if (in_interrupt() || irqs_disabled() || in_atomic())
+		flags = GFP_ATOMIC;
+
+	skb = __netdev_alloc_skb(NULL, size, flags);
 
 	if (skb)
 		goto skb_alloc;