summaryrefslogtreecommitdiff
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorArik Nemtsov <arik@wizery.com>2012-07-05 18:30:58 +0400
committerLuciano Coelho <coelho@ti.com>2012-07-18 16:08:21 +0400
commit45777c49ec376f5325e9ebbca85ee3e71697b0d2 (patch)
tree024711175b2af6210385ec7eed817134625aaaa1 /drivers/net/wireless
parent097b0e1bf18a00195cd89bb13565ddbc9b0df942 (diff)
downloadlinux-45777c49ec376f5325e9ebbca85ee3e71697b0d2.tar.xz
wl18xx: alloc conf.phy memory to ensure alignemnt
We get DMA alignment trouble if the beginning of the conf.phy struct is not aligned to 4 bytes. Use kmemdup to ensure alignment. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/ti/wl18xx/main.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c
index b378b34c4a6a..8bb21b6458b8 100644
--- a/drivers/net/wireless/ti/wl18xx/main.c
+++ b/drivers/net/wireless/ti/wl18xx/main.c
@@ -772,16 +772,24 @@ out:
static int wl18xx_set_mac_and_phy(struct wl1271 *wl)
{
struct wl18xx_priv *priv = wl->priv;
+ struct wl18xx_mac_and_phy_params *params;
int ret;
+ params = kmemdup(&priv->conf.phy, sizeof(*params), GFP_KERNEL);
+ if (!params) {
+ ret = -ENOMEM;
+ goto out;
+ }
+
ret = wlcore_set_partition(wl, &wl->ptable[PART_PHY_INIT]);
if (ret < 0)
goto out;
- ret = wlcore_write(wl, WL18XX_PHY_INIT_MEM_ADDR, (u8 *)&priv->conf.phy,
- sizeof(struct wl18xx_mac_and_phy_params), false);
+ ret = wlcore_write(wl, WL18XX_PHY_INIT_MEM_ADDR, params,
+ sizeof(*params), false);
out:
+ kfree(params);
return ret;
}