typhoon: memory corruptor on big-endian if TSO is enabled
authorAl Viro <viro@ftp.linux.org.uk>
Fri, 21 Dec 2007 06:21:03 +0000 (06:21 +0000)
committerJeff Garzik <jeff@garzik.org>
Sun, 23 Dec 2007 03:53:06 +0000 (22:53 -0500)
txlo_dma_addr should be host-endian; we pass it to typhoon_tso_fill(),
which does arithmetics on it, converts to l-e and passes it to card.
Unfortunately, we forgot le32_to_cpu() when initializing it from
face->txLoAddr, which sits in shared memory and is little-endian.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/typhoon.c

index 501abe37904734d2feaf01e53d39112556ea2e97..2550d4cf9609e0e742e40a4eb6b27dc7509406ff 100644 (file)
@@ -1320,7 +1320,7 @@ typhoon_init_interface(struct typhoon *tp)
        tp->txLoRing.writeRegister = TYPHOON_REG_TX_LO_READY;
        tp->txHiRing.writeRegister = TYPHOON_REG_TX_HI_READY;
 
-       tp->txlo_dma_addr = iface->txLoAddr;
+       tp->txlo_dma_addr = le32_to_cpu(iface->txLoAddr);
        tp->card_state = Sleeping;
        smp_wmb();