Skip to content

Commit

Permalink
IB/ehca: use kvfree() in ipz_queue_{cd}tor()
Browse files Browse the repository at this point in the history
Use kvfree() instead of open-coding it.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
Cc: Hoang-Nam Nguyen <hnguyen@de.ibm.com>
Cc: Christoph Raisch <raisch@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
penberg authored and torvalds committed Jul 1, 2015
1 parent 48a2013 commit f8c5b93
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions drivers/infiniband/hw/ehca/ipz_pt_fn.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,7 @@ int ipz_queue_ctor(struct ehca_pd *pd, struct ipz_queue *queue,
ipz_queue_ctor_exit0:
ehca_gen_err("Couldn't alloc pages queue=%p "
"nr_of_pages=%x", queue, nr_of_pages);
if (is_vmalloc_addr(queue->queue_pages))
vfree(queue->queue_pages);
else
kfree(queue->queue_pages);
kvfree(queue->queue_pages);

return 0;
}
Expand All @@ -270,10 +267,7 @@ int ipz_queue_dtor(struct ehca_pd *pd, struct ipz_queue *queue)
free_page((unsigned long)queue->queue_pages[i]);
}

if (is_vmalloc_addr(queue->queue_pages))
vfree(queue->queue_pages);
else
kfree(queue->queue_pages);
kvfree(queue->queue_pages);

return 1;
}
Expand Down

0 comments on commit f8c5b93

Please sign in to comment.