diff options
author | David S. Miller <davem@davemloft.net> | 2008-07-18 05:39:39 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-07-18 05:39:39 -0400 |
commit | 49997d75152b3d23c53b0fa730599f2f74c92c65 (patch) | |
tree | 46e93126170d02cfec9505172e545732c1b69656 /drivers/net/myri10ge | |
parent | a0c80b80e0fb48129e4e9d6a9ede914f9ff1850d (diff) | |
parent | 5b664cb235e97afbf34db9c4d77f08ebd725335e (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts:
Documentation/powerpc/booting-without-of.txt
drivers/atm/Makefile
drivers/net/fs_enet/fs_enet-main.c
drivers/pci/pci-acpi.c
net/8021q/vlan.c
net/iucv/iucv.c
Diffstat (limited to 'drivers/net/myri10ge')
-rw-r--r-- | drivers/net/myri10ge/myri10ge.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index 9a68d2ea5f3e..b3981ed972bf 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c | |||
@@ -556,6 +556,7 @@ static int myri10ge_load_hotplug_firmware(struct myri10ge_priv *mgp, u32 * size) | |||
556 | unsigned crc, reread_crc; | 556 | unsigned crc, reread_crc; |
557 | const struct firmware *fw; | 557 | const struct firmware *fw; |
558 | struct device *dev = &mgp->pdev->dev; | 558 | struct device *dev = &mgp->pdev->dev; |
559 | unsigned char *fw_readback; | ||
559 | struct mcp_gen_header *hdr; | 560 | struct mcp_gen_header *hdr; |
560 | size_t hdr_offset; | 561 | size_t hdr_offset; |
561 | int status; | 562 | int status; |
@@ -598,9 +599,15 @@ static int myri10ge_load_hotplug_firmware(struct myri10ge_priv *mgp, u32 * size) | |||
598 | mb(); | 599 | mb(); |
599 | readb(mgp->sram); | 600 | readb(mgp->sram); |
600 | } | 601 | } |
602 | fw_readback = vmalloc(fw->size); | ||
603 | if (!fw_readback) { | ||
604 | status = -ENOMEM; | ||
605 | goto abort_with_fw; | ||
606 | } | ||
601 | /* corruption checking is good for parity recovery and buggy chipset */ | 607 | /* corruption checking is good for parity recovery and buggy chipset */ |
602 | memcpy_fromio(fw->data, mgp->sram + MYRI10GE_FW_OFFSET, fw->size); | 608 | memcpy_fromio(fw_readback, mgp->sram + MYRI10GE_FW_OFFSET, fw->size); |
603 | reread_crc = crc32(~0, fw->data, fw->size); | 609 | reread_crc = crc32(~0, fw_readback, fw->size); |
610 | vfree(fw_readback); | ||
604 | if (crc != reread_crc) { | 611 | if (crc != reread_crc) { |
605 | dev_err(dev, "CRC failed(fw-len=%u), got 0x%x (expect 0x%x)\n", | 612 | dev_err(dev, "CRC failed(fw-len=%u), got 0x%x (expect 0x%x)\n", |
606 | (unsigned)fw->size, reread_crc, crc); | 613 | (unsigned)fw->size, reread_crc, crc); |