linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] wlcore: fixup an allocation
@ 2012-04-17  6:28 Dan Carpenter
  2012-05-03 12:54 ` Luciano Coelho
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2012-04-17  6:28 UTC (permalink / raw)
  To: Luciano Coelho
  Cc: John W. Linville, Eliad Peller, Arik Nemtsov, Shahar Levi,
	linux-wireless, kernel-janitors

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>
---
I don't have the hardware to test this.  Sorry.

diff --git a/drivers/net/wireless/ti/wlcore/cmd.c b/drivers/net/wireless/ti/wlcore/cmd.c
index 5c4716c..7ea10e1 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)
 	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);
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch] wlcore: fixup an allocation
  2012-04-17  6:28 [patch] wlcore: fixup an allocation Dan Carpenter
@ 2012-05-03 12:54 ` Luciano Coelho
  0 siblings, 0 replies; 2+ messages in thread
From: Luciano Coelho @ 2012-05-03 12:54 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: John W. Linville, Eliad Peller, Arik Nemtsov, Shahar Levi,
	linux-wireless, kernel-janitors

On Tue, 2012-04-17 at 09:28 +0300, Dan Carpenter wrote:
> 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>
> ---
> I don't have the hardware to test this.  Sorry.

Applied, thanks! I ran some very basic tests on it.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-05-03 12:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-17  6:28 [patch] wlcore: fixup an allocation Dan Carpenter
2012-05-03 12:54 ` Luciano Coelho

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).