net: wireless: bcmdhd: Allocate skb with GFP_KERNEL flag if possible

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
This commit is contained in:
Dmitry Shmidt
2011-06-13 16:42:13 -07:00
committed by Colin Cross
parent 1154e25e0f
commit 63a3dfafbc

View File

@@ -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++;
}