[patch 22/33] p54: fix p54_read_eeprom to cope with tx_hdr_len
From: Greg KH
Date: Wed Feb 04 2009 - 13:45:29 EST
2.6.28-stable review patch. If anyone has any objections, please let us know.
------------------
From: Christian Lamparter <chunkeey@xxxxxx>
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@xxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>
---
drivers/net/wireless/p54/p54common.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
--- a/drivers/net/wireless/p54/p54common.c
+++ b/drivers/net/wireless/p54/p54common.c
@@ -741,17 +741,19 @@ static void p54_assign_address(struct ie
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
free:
kfree(priv->eeprom);
priv->eeprom = NULL;
- kfree(hdr);
+ kfree(org_hdr);
kfree(eeprom);
return ret;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/