summaryrefslogtreecommitdiff
path: root/wl1271/platforms/os/linux/inc/wbuf.h
diff options
context:
space:
mode:
Diffstat (limited to 'wl1271/platforms/os/linux/inc/wbuf.h')
-rw-r--r--wl1271/platforms/os/linux/inc/wbuf.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/wl1271/platforms/os/linux/inc/wbuf.h b/wl1271/platforms/os/linux/inc/wbuf.h
index 1dbeb1d..4894cd6 100644
--- a/wl1271/platforms/os/linux/inc/wbuf.h
+++ b/wl1271/platforms/os/linux/inc/wbuf.h
@@ -108,9 +108,15 @@ typedef struct
*/
static inline WBUF *WbufAlloc (TI_HANDLE hOs, TI_UINT32 len)
{
- WBUF *pWbuf = alloc_skb (len + WSPI_PAD_BYTES, GFP_ATOMIC);
- WBUF_DATA (pWbuf) += WSPI_PAD_BYTES;
- return pWbuf;
+ gfp_t flags = (in_atomic()) ? GFP_ATOMIC : GFP_KERNEL;
+ WBUF *pWbuf = alloc_skb(len + WSPI_PAD_BYTES, flags);
+
+ if (!pWbuf)
+ {
+ return NULL;
+ }
+ WBUF_DATA (pWbuf) += WSPI_PAD_BYTES;
+ return pWbuf;
}
#define WbufFree(hOs, pWbuf) ( dev_kfree_skb((struct sk_buff *)pWbuf) )