mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 22:26:55 +00:00
f39f87e9ea
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> |
||
---|---|---|
.. | ||
android | ||
bcm | ||
board | ||
comedi | ||
cptm1217 | ||
dgap | ||
dgnc | ||
emxx_udc | ||
et131x | ||
ft1000 | ||
fwserial | ||
gdm72xx | ||
gdm724x | ||
goldfish | ||
gs_fpgaboot | ||
iio | ||
imx-drm | ||
line6 | ||
lustre | ||
media | ||
mt29f_spinand | ||
netlogic | ||
nvec | ||
octeon | ||
octeon-usb | ||
olpc_dcon | ||
ozwpan | ||
panel | ||
rtl8188eu | ||
rtl8192e | ||
rtl8192ee | ||
rtl8192u | ||
rtl8712 | ||
rtl8723au | ||
rtl8821ae | ||
rts5208 | ||
skein | ||
slicoss | ||
speakup | ||
ste_rmi4 | ||
unisys | ||
vme | ||
vt6655 | ||
vt6656 | ||
wlan-ng | ||
xgifb | ||
xillybus | ||
Kconfig | ||
Makefile | ||
staging.c |