]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ath5k: consistently use rx_bufsize for RX DMA
authorBruno Randolf <br1@einfach.org>
Wed, 19 May 2010 01:18:16 +0000 (10:18 +0900)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 5 Jul 2010 18:15:44 +0000 (11:15 -0700)
commit64b914d6daa61a17a8124a9b705de325178d59e0
tree569448f5c285eb102da0308666e58a978e606462
parent6326f9f3d95b2c01ae24fb8a9fe6928e0b026e7f
ath5k: consistently use rx_bufsize for RX DMA

commit b5eae9ff5ba6d76de19286dd6429acd7cde3f79d upstream.

We should use the same buffer size we set up for DMA also in the hardware
descriptor. Previously we used common->rx_bufsize for setting up the DMA
mapping, but used skb_tailroom(skb) for the size we tell to the hardware in the
descriptor itself. The problem is that skb_tailroom(skb) can give us a larger
value than the size we set up for DMA before. This allows the hardware to write
into memory locations not set up for DMA. In practice this should rarely happen
because all packets should be smaller than the maximum 802.11 packet size.

On the tested platform rx_bufsize is 2528, and we allocated an skb of 2559
bytes length (including padding for cache alignment) but sbk_tailroom() was
2592. Just consistently use rx_bufsize for all RX DMA memory sizes.

Also use the return value of the descriptor setup function.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Reviewed-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/net/wireless/ath/ath5k/base.c