From e13603951a141aca864cb91826916b2b53ef98be Mon Sep 17 00:00:00 2001 From: Dmitry Shmidt Date: Mon, 13 Jun 2011 16:42:13 -0700 Subject: [PATCH] net: wireless: bcmdhd: Allocate skb with GFP_KERNEL flag if possible Signed-off-by: Dmitry Shmidt --- drivers/net/wireless/bcmdhd/linux_osl.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/bcmdhd/linux_osl.c b/drivers/net/wireless/bcmdhd/linux_osl.c index 14b9aa1..bfbfc88 100644 --- a/drivers/net/wireless/bcmdhd/linux_osl.c +++ b/drivers/net/wireless/bcmdhd/linux_osl.c @@ -246,6 +246,13 @@ osl_detach(osl_t *osh) kfree(osh); } +struct sk_buff *osl_alloc_skb(unsigned int len) +{ + gfp_t flags = (in_atomic()) ? GFP_ATOMIC : GFP_KERNEL; + + return __dev_alloc_skb(len, flags); +} + #ifdef CTFPOOL void * @@ -266,7 +273,7 @@ osl_ctfpool_add(osl_t *osh) } - skb = dev_alloc_skb(osh->ctfpool->obj_size); + skb = osl_alloc_skb(osh->ctfpool->obj_size); if (skb == NULL) { printf("%s: skb alloc of len %d failed\n", __FUNCTION__, osh->ctfpool->obj_size); @@ -426,7 +433,7 @@ osl_pktfastget(osl_t *osh, uint len) return skb; } -#endif +#endif void * BCMFASTPATH @@ -435,16 +442,14 @@ osl_pktget(osl_t *osh, uint len) struct sk_buff *skb; #ifdef CTFPOOL - skb = osl_pktfastget(osh, len); - if ((skb != NULL) || ((skb = dev_alloc_skb(len)) != NULL)) { -#else - if ((skb = dev_alloc_skb(len))) { -#endif + if ((skb != NULL) || ((skb = osl_alloc_skb(len)) != NULL)) { +#else + if ((skb = osl_alloc_skb(len))) { +#endif skb_put(skb, len); skb->priority = 0; - osh->pub.pktalloced++; } -- 2.7.4