diff options
author | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2011-07-17 14:22:32 +0200 |
---|---|---|
committer | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2011-07-17 14:22:32 +0200 |
commit | 06b3e35cc964d4735bd62d293b9d51f689545f97 (patch) | |
tree | 6011078f428ec1b3c2506643529c3d00cfd29c28 /kmem.c | |
parent | ec5fd54c7559392139fa704a57185f4d4244dfde (diff) | |
download | ipecamera-06b3e35cc964d4735bd62d293b9d51f689545f97.tar.gz ipecamera-06b3e35cc964d4735bd62d293b9d51f689545f97.tar.bz2 ipecamera-06b3e35cc964d4735bd62d293b9d51f689545f97.tar.xz ipecamera-06b3e35cc964d4735bd62d293b9d51f689545f97.zip |
Handle correctly reference counting in the driver
Diffstat (limited to 'kmem.c')
-rw-r--r-- | kmem.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -87,7 +87,6 @@ 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; @@ -141,7 +140,7 @@ pcilib_kmem_handle_t *pcilib_alloc_kernel_memory(pcilib_t *ctx, pcilib_kmem_type kbuf->buf.blocks[i].size -= alignment; } - addr = mmap( 0, kh.size + kbuf->buf.blocks[i].alignment_offset, PROT_WRITE | PROT_READ, MAP_SHARED, ctx->handle, 0 ); + addr = mmap( 0, kbuf->buf.blocks[i].size + kbuf->buf.blocks[i].alignment_offset, PROT_WRITE | PROT_READ, MAP_SHARED, ctx->handle, 0 ); if ((!addr)||(addr == MAP_FAILED)) { kbuf->buf.n_blocks = i + 1; error = "Failed to mmap allocated kernel memory"; |