diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2012-04-17 02:28:47 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-05-15 17:53:24 -0400 |
commit | 0230dfea09f7319658c86c07f5507092366dfc00 (patch) | |
tree | 3be3a6cfa0b45ff34bb9dc130ca2e248cefa6bcd | |
parent | cd840f6a0d6522e37c49def0eabb1e2134b68f1d (diff) |
wlcore: fixup an allocation
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>
-rw-r--r-- | drivers/net/wireless/ti/wlcore/cmd.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/wireless/ti/wlcore/cmd.c b/drivers/net/wireless/ti/wlcore/cmd.c index 5c4716c6f040..7ea10e1c98bf 100644 --- a/drivers/net/wireless/ti/wlcore/cmd.c +++ b/drivers/net/wireless/ti/wlcore/cmd.c | |||
@@ -123,7 +123,9 @@ static int wl1271_cmd_wait_for_event_or_timeout(struct wl1271 *wl, u32 mask) | |||
123 | unsigned long timeout; | 123 | unsigned long timeout; |
124 | int ret = 0; | 124 | int ret = 0; |
125 | 125 | ||
126 | events_vector = kmalloc(sizeof(*events_vector), GFP_DMA); | 126 | events_vector = kmalloc(sizeof(*events_vector), GFP_KERNEL | GFP_DMA); |
127 | if (!events_vector) | ||
128 | return -ENOMEM; | ||
127 | 129 | ||
128 | timeout = jiffies + msecs_to_jiffies(WL1271_EVENT_TIMEOUT); | 130 | timeout = jiffies + msecs_to_jiffies(WL1271_EVENT_TIMEOUT); |
129 | 131 | ||