Skip to contentSkip to conversation

cxgb4: allocate enough data in t4_memory_rw()

PATCH Applied Dan Carpenter 2 participants 2 messages Oct 8, 2012

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cxgb4: allocate enough data in t4_memory_rw()

MEMWIN0_APERTURE is the size in bytes.

---
This was introduced in 8c357ebd569 "cxgb4: Dynamically allocate memory in t4_memory_rw() and get_vpd_params()" from Oct 3.

drivers/net/ethernet/chelsio/cxgb4/t4_hw.c +1 -1
index 137a244..e914c41 100644
@@ -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;
 
maintainer Applied
#1 lore raw

From: Dan Carpenter <[email protected]>
Date: Mon, 8 Oct 2012 10:12:11 +0300

Quoted 3 lines

MEMWIN0_APERTURE is the size in bytes.

Applied, thanks Dan.

Quoted 3 lines

---
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...