From ec5fd54c7559392139fa704a57185f4d4244dfde Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Sun, 17 Jul 2011 06:25:14 +0200 Subject: Few fixes --- kmem.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'kmem.c') diff --git a/kmem.c b/kmem.c index d7f2833..5511b7a 100644 --- a/kmem.c +++ b/kmem.c @@ -24,7 +24,7 @@ static int pcilib_free_kernel_buffer(pcilib_t *ctx, pcilib_kmem_list_t *kbuf, si kh.handle_id = kbuf->buf.blocks[i].handle_id; kh.pa = kbuf->buf.blocks[i].pa; kh.flags = flags; - + return ioctl(ctx->handle, PCIDRIVER_IOC_KMEM_FREE, &kh); } @@ -87,6 +87,7 @@ pcilib_kmem_handle_t *pcilib_alloc_kernel_memory(pcilib_t *ctx, pcilib_kmem_type kh.size += alignment; } + printf("KMEM Flags: %lx\n", flags); for ( i = 0; i < nmemb; i++) { kh.item = i; kh.flags = flags; @@ -202,7 +203,7 @@ void pcilib_free_kernel_memory(pcilib_t *ctx, pcilib_kmem_handle_t *k, pcilib_km else if (ctx->kmem_list == kbuf) ctx->kmem_list = kbuf->next; for (i = 0; i < kbuf->buf.n_blocks; i++) { - ret = pcilib_free_kernel_buffer(ctx, kbuf, --kbuf->buf.n_blocks, flags); + ret = pcilib_free_kernel_buffer(ctx, kbuf, i, flags); if ((ret)&&(!err)) err = ret; } -- cgit v1.2.3