From patchwork Mon Oct 8 07:12:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: cxgb4: allocate enough data in t4_memory_rw() Date: Sun, 07 Oct 2012 21:12:11 -0000 From: Dan Carpenter X-Patchwork-Id: 189922 Message-Id: <20121008071210.GA17400@elgon.mountain> To: Dimitris Michailidis , Vipul Pandya Cc: netdev@vger.kernel.org, kernel-janitors@vger.kernel.org MEMWIN0_APERTURE is the size in bytes. Signed-off-by: Dan Carpenter --- This was introduced in 8c357ebd569 "cxgb4: Dynamically allocate memory in t4_memory_rw() and get_vpd_params()" from Oct 3. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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;