diff options
author | Alexey Kardashevskiy <aik@ozlabs.ru> | 2015-03-13 19:23:31 +1100 |
---|---|---|
committer | Alexey Kardashevskiy <aik@ozlabs.ru> | 2015-03-13 20:06:46 +1100 |
commit | 8d96fe983fac761677453b06b0d7054db8e681f6 (patch) | |
tree | f8b1c82d4765832f46819e10a6cb5ed8759d7f37 /include/helpers.h | |
parent | a3d4e896e57ac16ec1e5350eecb96715cdfb0559 (diff) | |
download | SLOF-8d96fe983fac761677453b06b0d7054db8e681f6.zip SLOF-8d96fe983fac761677453b06b0d7054db8e681f6.tar.gz SLOF-8d96fe983fac761677453b06b0d7054db8e681f6.tar.bz2 |
helpers: Fix SLOF_alloc_mem_aligned to meet callers expectation
Every caller of SLOF_alloc_mem_aligned() assumes the size is the first
argument while it is not.
This switches align and size and fixes random memory corruptions.
This is grep for SLOF_alloc_mem_aligned with this patch applied:
include/helpers.h|27| extern void *SLOF_alloc_mem_aligned(long size, long align);
lib/libveth/veth.c|103| buffer_list = SLOF_alloc_mem_aligned(8192, 4096);
lib/libveth/veth.c|105| rx_queue = SLOF_alloc_mem_aligned(rx_queue_len, 16);
lib/libvirtio/virtio-net.c|101| vq[i].desc = SLOF_alloc_mem_aligned(virtio_vring_size(vq[i].size), 4096);
slof/helpers.c|70| void *SLOF_alloc_mem_aligned(long size, long align)
Reviewed-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Diffstat (limited to 'include/helpers.h')
-rw-r--r-- | include/helpers.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/helpers.h b/include/helpers.h index f6d4375..fb10534 100644 --- a/include/helpers.h +++ b/include/helpers.h @@ -24,7 +24,7 @@ extern void SLOF_usleep(uint32_t time); extern void *SLOF_dma_alloc(long size); extern void SLOF_dma_free(void *virt, long size); extern void *SLOF_alloc_mem(long size); -extern void *SLOF_alloc_mem_aligned(long align, long size); +extern void *SLOF_alloc_mem_aligned(long size, long align); extern void SLOF_free_mem(void *addr, long size); extern long SLOF_dma_map_in(void *virt, long size, int cacheable); extern void SLOF_dma_map_out(long phys, void *virt, long size); |