IB/ehca: use kvfree() in ipz_queue_{cd}tor()
authorPekka Enberg <penberg@kernel.org>
Tue, 30 Jun 2015 21:59:21 +0000 (14:59 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 1 Jul 2015 02:45:00 +0000 (19:45 -0700)
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>
drivers/infiniband/hw/ehca/ipz_pt_fn.c

index 8d594517cd292821182e0dc363a32ea0f6d98c9f..7ffc748cb97357fa3aeb4d6f8e2f20cbff5d2ecf 100644 (file)
@@ -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;
 }
@@ -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;
 }