wlcore: fixup an allocation
Subsystems (2)
PATCH 1/1 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 <[email protected]>
---
I don't have the hardware to test this. Sorry.
drivers/net/wireless/ti/wlcore/cmd.c +3 -1
@@ -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 );
Quoted 7 lines · Dan Carpenter
GFP_DMAisn't supposed to be used by itself. This allocation is allowed to sleep so it should be ORing it withGFP_KERNEL.
Also we should check for allocations errors.Signed-off-by Dan Carpenter <[email protected]>---
I don't have the hardware to test this. Sorry.
Applied, thanks! I ran some very basic tests on it.