diff options
author | Dmitry Shmidt <dimitrysh@google.com> | 2011-08-23 15:27:40 -0700 |
---|---|---|
committer | Dmitry Shmidt <dimitrysh@google.com> | 2011-08-31 10:23:58 -0700 |
commit | 8fba1f1c8f2f2820b2ed8a1e4b6567d172636c6a (patch) | |
tree | 5c96651ad11feede9ffc83390634274cc319d617 /drivers/net | |
parent | 5e4fcd2c556e25e1b6787dcd0c97b06e29e42292 (diff) | |
download | kernel_samsung_crespo-8fba1f1c8f2f2820b2ed8a1e4b6567d172636c6a.zip kernel_samsung_crespo-8fba1f1c8f2f2820b2ed8a1e4b6567d172636c6a.tar.gz kernel_samsung_crespo-8fba1f1c8f2f2820b2ed8a1e4b6567d172636c6a.tar.bz2 |
net: wireless: bcmdhd: Use allocation with GFP_ATOMIC only in atomic context
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/bcmdhd/linux_osl.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/net/wireless/bcmdhd/linux_osl.c b/drivers/net/wireless/bcmdhd/linux_osl.c index bbb2408..239b15d 100644 --- a/drivers/net/wireless/bcmdhd/linux_osl.c +++ b/drivers/net/wireless/bcmdhd/linux_osl.c @@ -167,8 +167,10 @@ osl_t * osl_attach(void *pdev, uint bustype, bool pkttag) { osl_t *osh; + gfp_t flags; - osh = kmalloc(sizeof(osl_t), GFP_ATOMIC); + flags = (in_atomic()) ? GFP_ATOMIC : GFP_KERNEL; + osh = kmalloc(sizeof(osl_t), flags); ASSERT(osh); bzero(osh, sizeof(osl_t)); @@ -321,7 +323,10 @@ osl_ctfpool_replenish(osl_t *osh, uint thresh) int32 osl_ctfpool_init(osl_t *osh, uint numobj, uint size) { - osh->ctfpool = kmalloc(sizeof(ctfpool_t), GFP_ATOMIC); + gfp_t flags; + + flags = (in_atomic()) ? GFP_ATOMIC : GFP_KERNEL; + osh->ctfpool = kmalloc(sizeof(ctfpool_t), flags); ASSERT(osh->ctfpool); bzero(osh->ctfpool, sizeof(ctfpool_t)); @@ -710,12 +715,13 @@ void * osl_malloc(osl_t *osh, uint size) { void *addr; - + gfp_t flags; if (osh) ASSERT(osh->magic == OS_HANDLE_MAGIC); - if ((addr = kmalloc(size, GFP_ATOMIC)) == NULL) { + flags = (in_atomic()) ? GFP_ATOMIC : GFP_KERNEL; + if ((addr = kmalloc(size, flags)) == NULL) { if (osh) osh->failed++; return (NULL); @@ -843,8 +849,10 @@ void * osl_pktdup(osl_t *osh, void *skb) { void * p; + gfp_t flags; - if ((p = skb_clone((struct sk_buff*)skb, GFP_ATOMIC)) == NULL) + flags = (in_atomic()) ? GFP_ATOMIC : GFP_KERNEL; + if ((p = skb_clone((struct sk_buff *)skb, flags)) == NULL) return NULL; #ifdef CTFPOOL |