linux-stable/drivers/staging
Ian Abbott f39f87e9ea staging: comedi: adl_pci9118: don't overallocate DMA buffer
The last parameter of `__get_free_pages()` is log2 (the 'order') of the
number of pages to be allocated.  This driver seems to think it is the
linear number of pages, so `pci9118_alloc_dma()` first tries to allocate
16 pages, but only uses 4 of them, setting the buffer size to PAGE_SIZE
multiplied by the 'order'.  If the allocation fails, it tries
progressively smaller orders, down to 0.  If the allocation at order 0
succeeds, the buffer size is set to 0, which is likely to cause
problems.

Set the buffer size to `PAGE_SIZE` shifted left by the allocation order.
Since the maximum buffer size previously used was 4, start with an
allocation order of 2 instead of 4.  Rename the `pages` member of
`struct pci9118_dmabuf` (and the local variable in
`pci9118_alloc_dma()`) to `order` to make it clearer what it is.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19 15:36:25 -07:00
..
android Merge 3.17-rc5 into staging-next. 2014-09-14 19:33:47 -07:00
bcm staging: bcm: sort.c: fix coding style 2014-09-08 14:01:17 -07:00
board
comedi staging: comedi: adl_pci9118: don't overallocate DMA buffer 2014-09-19 15:36:25 -07:00
cptm1217
dgap drivers: staging: dgap: fix the checkpatch.pl issue "Warning: line over 80 characters" 2014-09-06 21:46:55 -07:00
dgnc staging: dgnc: split two assignments into the two assignments on two lines. 2014-09-02 10:44:33 -07:00
emxx_udc staging: emxx_udc: fix style warnings: const strings should be const char 2014-09-11 14:55:55 -07:00
et131x staging: et131x: Fix whitespace - alignment matching open parenthesis 2014-09-08 13:47:01 -07:00
ft1000 drivers: staging: ft1000: Fix return is not a function, parentheses are not required errors 2014-09-02 10:48:32 -07:00
fwserial
gdm72xx
gdm724x
goldfish staging: goldfish: avoid multiple assignments 2014-09-06 21:54:57 -07:00
gs_fpgaboot staging: gs_fpgaboot: remove checks for CONFIG_B4860G100 2014-09-08 14:00:07 -07:00
iio staging: iio: light: isl29018: add ACPI support 2014-09-13 17:55:54 +01:00
imx-drm Merge 3.17-rc5 into staging-next. 2014-09-14 19:33:47 -07:00
line6
lustre Merge 3.17-rc5 into staging-next. 2014-09-14 19:33:47 -07:00
media
mt29f_spinand
netlogic staging: netlogic: fix checkpatch.pl "LINE_SPACING" issuses 2014-09-08 14:02:13 -07:00
nvec
octeon
octeon-usb Staging: octeon-hcd: removed dummy label 2014-09-11 14:49:13 -07:00
olpc_dcon
ozwpan staging: ozwpan: use kmalloc_array over kmalloc with multiply 2014-09-08 13:26:33 -07:00
panel
rtl8188eu staging:rtl8188eu: Fix sparse warning cast to restricted __le16 2014-09-11 14:56:51 -07:00
rtl8192e staging: rtl8192e: fixed coding style issues 2014-08-30 13:54:03 -07:00
rtl8192ee
rtl8192u staging:r8190_rtl8256: coding style: Fixed commenting style 2014-09-11 14:47:59 -07:00
rtl8712
rtl8723au drivers: staging: rtl8723au: Fix 'code indent should use tabs where possible' errors 2014-09-11 14:47:59 -07:00
rtl8821ae drivers: staging: rtl8821ae: Fix '"(foo*)" should be "(foo *)"' errors 2014-09-08 14:01:17 -07:00
rts5208 staging: rts5208: Remove casting the return value which is a void pointer 2014-08-30 14:07:37 -07:00
skein
slicoss
speakup staging: speakup: fix missing blank lines after declarations 2014-09-11 14:54:51 -07:00
ste_rmi4
unisys staging: unisys: uislib: uislib.c: sparse warning of context imbalance 2014-09-11 14:49:13 -07:00
vme staging: vme: remove redundant else condition 2014-08-30 14:06:47 -07:00
vt6655 staging: vt6655: Remove unnecessary condition around include 2014-09-11 14:59:18 -07:00
vt6656 staging: vt6656: remove rate_control_algorithm pid 2014-09-08 14:01:17 -07:00
wlan-ng Staging: wlan-ng: Remove redundant break/goto statements in hfa384x_usb.c 2014-09-08 14:02:48 -07:00
xgifb staging: xgifb: remove unnecessary else 2014-09-06 21:48:19 -07:00
xillybus staging: xillybus: Removed unnecessary cast 2014-09-08 13:59:25 -07:00
Kconfig Merge 3.17-rc3 into staging-next 2014-08-31 20:53:12 -07:00
Makefile Merge 3.17-rc3 into staging-next 2014-08-31 20:53:12 -07:00
staging.c