Skip to content

Commit

Permalink
wlcore: fixup an allocation
Browse files Browse the repository at this point in the history
GFP_DMA isn't supposed to be used by itself.  This allocation is allowed
to sleep so it should be ORing it with GFP_KERNEL.
Also we should check for allocations errors.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
  • Loading branch information
Dan Carpenter authored and John W. Linville committed May 15, 2012
1 parent cd840f6 commit 0230dfe
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/wireless/ti/wlcore/cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ static int wl1271_cmd_wait_for_event_or_timeout(struct wl1271 *wl, u32 mask)
unsigned long timeout;
int ret = 0;

events_vector = kmalloc(sizeof(*events_vector), GFP_DMA);
events_vector = kmalloc(sizeof(*events_vector), GFP_KERNEL | GFP_DMA);
if (!events_vector)
return -ENOMEM;

timeout = jiffies + msecs_to_jiffies(WL1271_EVENT_TIMEOUT);

Expand Down

0 comments on commit 0230dfe

Please sign in to comment.