diff options
author | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2011-07-17 06:25:14 +0200 |
---|---|---|
committer | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2011-07-17 06:25:14 +0200 |
commit | ec5fd54c7559392139fa704a57185f4d4244dfde (patch) | |
tree | 05c138b1d5a350f5454a1a18bd051546e7cf8632 /kmem.c | |
parent | 112030c40f88dde281073e00e4c24cc48daa99d2 (diff) | |
download | pcitool-ec5fd54c7559392139fa704a57185f4d4244dfde.tar.gz pcitool-ec5fd54c7559392139fa704a57185f4d4244dfde.tar.bz2 pcitool-ec5fd54c7559392139fa704a57185f4d4244dfde.tar.xz pcitool-ec5fd54c7559392139fa704a57185f4d4244dfde.zip |
Few fixes
Diffstat (limited to 'kmem.c')
-rw-r--r-- | kmem.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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; } |