common/mlx5/linux: replace malloc and free in glue
[dpdk.git] / drivers / common / mlx5 / mlx5_common.c
index 79357e2..06f0a64 100644 (file)
@@ -198,7 +198,7 @@ mlx5_get_dbr(void *ctx,  struct mlx5_dbr_page_list *head,
        page->dbr_bitmap[i] |= (UINT64_C(1) << j);
        page->dbr_count++;
        *dbr_page = page;
-       return (((i * 64) + j) * sizeof(uint64_t));
+       return (i * CHAR_BIT * sizeof(uint64_t) + j) * MLX5_DBR_SIZE;
 }
 
 /**