mlx4: don't duplicate kvfree()
authorAl Viro <viro@ZenIV.linux.org.uk>
Thu, 20 Nov 2014 08:15:38 +0000 (08:15 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 21 Nov 2014 19:58:18 +0000 (14:58 -0500)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Acked-by: Amir Vadai <amirv@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/mr.c

index 193a6ad..d6f5496 100644 (file)
@@ -130,10 +130,7 @@ static int mlx4_buddy_init(struct mlx4_buddy *buddy, int max_order)
 
 err_out_free:
        for (i = 0; i <= buddy->max_order; ++i)
-               if (buddy->bits[i] && is_vmalloc_addr(buddy->bits[i]))
-                       vfree(buddy->bits[i]);
-               else
-                       kfree(buddy->bits[i]);
+               kvfree(buddy->bits[i]);
 
 err_out:
        kfree(buddy->bits);
@@ -147,10 +144,7 @@ static void mlx4_buddy_cleanup(struct mlx4_buddy *buddy)
        int i;
 
        for (i = 0; i <= buddy->max_order; ++i)
-               if (is_vmalloc_addr(buddy->bits[i]))
-                       vfree(buddy->bits[i]);
-               else
-                       kfree(buddy->bits[i]);
+               kvfree(buddy->bits[i]);
 
        kfree(buddy->bits);
        kfree(buddy->num_free);