[patch] cxgb4: allocate enough data in t4_memory_rw()

Subsystems: cxgb4 ethernet driver (cxgb4), networking drivers, the rest

STALE5113d

2 messages, 2 authors, 2012-10-08 · open the first message on its own page

[patch] cxgb4: allocate enough data in t4_memory_rw()

From: Dan Carpenter <hidden>
Date: 2012-10-08 07:12:25

MEMWIN0_APERTURE is the size in bytes.

Signed-off-by: Dan Carpenter <redacted>
---
This was introduced in 8c357ebd569 "cxgb4: Dynamically allocate memory
in t4_memory_rw() and get_vpd_params()" from Oct 3.
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
index 137a244..e914c41 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
@@ -417,7 +417,7 @@ static int t4_memory_rw(struct adapter *adap, int mtype, u32 addr, u32 len,
 	if ((addr & 0x3) || (len & 0x3))
 		return -EINVAL;
 
-	data = vmalloc(MEMWIN0_APERTURE/sizeof(__be32));
+	data = vmalloc(MEMWIN0_APERTURE);
 	if (!data)
 		return -ENOMEM;
 

Re: [patch] cxgb4: allocate enough data in t4_memory_rw()

From: David Miller <davem@davemloft.net>
Date: 2012-10-08 07:13:50

From: Dan Carpenter <redacted>
Date: Mon, 8 Oct 2012 10:12:11 +0300
MEMWIN0_APERTURE is the size in bytes.

Signed-off-by: Dan Carpenter <redacted>
Applied, thanks Dan.
---
This was introduced in 8c357ebd569 "cxgb4: Dynamically allocate memory
in t4_memory_rw() and get_vpd_params()" from Oct 3.
Sigh, putting bad on top of bad...
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help