]> git.baikalelectronics.ru Git - kernel.git/commit
at76c50x-usb: Don't perform DMA from stack memory
authorAndrea Merello <andrea.merello@gmail.com>
Sat, 24 May 2014 15:07:12 +0000 (17:07 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 29 May 2014 17:08:10 +0000 (13:08 -0400)
commitc4092b604a88d20b9d4ab21383f97e397a2987a7
treef24ac04cc82ca0b2baf8ce6e8f0aff24baebdfd5
parentc405b01a8e80ef32e5cc9f25d49677b5ee7bf021
at76c50x-usb: Don't perform DMA from stack memory

Loading the driver with DMA debugging enabled makes the kernel to complain
about the ehci driver trying to perform DMA from memory from the stack.

[ 9848.229514] WARNING: CPU: 1 PID: 627 at lib/dma-debug.c:1153 check_for_stack+0xa4/0xf0()
[ 9848.237678] ehci-pci 0000:00:04.1: DMA-API: device driver maps memory fromstack [addr=ffff88006c80da01]

This is due to at76c50x-usb driver passing buffers allocated on the stack to
the USB layer, that attempts DMA. This occurs is several places.

This patch fixes the problem by allocating those buffers via kmalloc.

Since this adds some kfree() before leaving a couple of functions, I caught the
occasion to clean-up the exit path on error.

Signed-off-by: Andrea Merello <andrea.merello@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/at76c50x-usb.c