diff options
author | Christian Lamparter <chunkeey@web.de> | 2009-01-24 10:44:40 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-02-06 13:47:20 -0800 |
commit | 621c147ff8fc7fca0d127e0e4c7c9c017560900a (patch) | |
tree | 9d18de95a6353b19ac5ee692f6aa7fd9327788b7 /drivers | |
parent | 631c7b5c602f9516cfe11c4556181c14bee6fdb3 (diff) |
p54: fix p54_read_eeprom to cope with tx_hdr_len
commit b92f30d65aeb0502e2ed8beb80c8465578b40002 upstream
This patch fixes a regression in "p54: move eeprom code into common library"
7cb770729ba895f73253dfcd46c3fcba45d896f9
Some of p54usb's devices need a little headroom for the transportation and
this was forgotten in the eeprom change.
Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/p54/p54common.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/net/wireless/p54/p54common.c b/drivers/net/wireless/p54/p54common.c index 827ca0384a4..b4831fd5b3e 100644 --- a/drivers/net/wireless/p54/p54common.c +++ b/drivers/net/wireless/p54/p54common.c @@ -741,17 +741,19 @@ static void p54_assign_address(struct ieee80211_hw *dev, struct sk_buff *skb, int p54_read_eeprom(struct ieee80211_hw *dev) { struct p54_common *priv = dev->priv; - struct p54_control_hdr *hdr = NULL; + struct p54_control_hdr *hdr = NULL, *org_hdr; struct p54_eeprom_lm86 *eeprom_hdr; size_t eeprom_size = 0x2020, offset = 0, blocksize; int ret = -ENOMEM; void *eeprom = NULL; - hdr = (struct p54_control_hdr *)kzalloc(sizeof(*hdr) + - sizeof(*eeprom_hdr) + EEPROM_READBACK_LEN, GFP_KERNEL); - if (!hdr) + org_hdr = kzalloc(priv->tx_hdr_len + sizeof(*hdr) + + sizeof(*eeprom_hdr) + EEPROM_READBACK_LEN, + GFP_KERNEL); + if (!org_hdr) goto free; + hdr = (void *) org_hdr + priv->tx_hdr_len; priv->eeprom = kzalloc(EEPROM_READBACK_LEN, GFP_KERNEL); if (!priv->eeprom) goto free; @@ -790,7 +792,7 @@ int p54_read_eeprom(struct ieee80211_hw *dev) free: kfree(priv->eeprom); priv->eeprom = NULL; - kfree(hdr); + kfree(org_hdr); kfree(eeprom); return ret; |