libertas if_usb: Fix crash on 64-bit machines
commit6e6276689ca89240c8faa575b64a36b356d7b8ab
authorDavid Woodhouse <dwmw2@infradead.org>
Fri, 30 Oct 2009 17:45:14 +0000 (30 17:45 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 10 Nov 2009 00:52:10 +0000 (9 16:52 -0800)
treeccbe96b849073672c9e62f76e64b5d42e2e62d6b
parent30aae6d58a0cc3447ca149de5b73769d6206477a
libertas if_usb: Fix crash on 64-bit machines

commit e9024a059f2c17fb2bfab212ee9d31511d7b8e57 upstream.

On a 64-bit kernel, skb->tail is an offset, not a pointer. The libertas
usb driver passes it to usb_fill_bulk_urb() anyway, causing interesting
crashes. Fix that by using skb->data instead.

This highlights a problem with usb_fill_bulk_urb(). It doesn't notice
when dma_map_single() fails and return the error to its caller as it
should. In fact it _can't_ currently return the error, since it returns
void.

So this problem was showing up only at unmap time, after we'd already
suffered memory corruption by doing DMA to a bogus address.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/net/wireless/libertas/if_usb.c