Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[sfrench/cifs-2.6.git] / fs / btrfs / check-integrity.c
index 833cf3c35b4df8d0040bac23809dc7fcc20cef3d..2e43fba4403566bd2393a9319821bda2924e9418 100644 (file)
@@ -1594,6 +1594,7 @@ static int btrfsic_read_block(struct btrfsic_state *state,
 {
        unsigned int num_pages;
        unsigned int i;
+       size_t size;
        u64 dev_bytenr;
        int ret;
 
@@ -1608,9 +1609,8 @@ static int btrfsic_read_block(struct btrfsic_state *state,
 
        num_pages = (block_ctx->len + (u64)PAGE_SIZE - 1) >>
                    PAGE_SHIFT;
-       block_ctx->mem_to_free = kcalloc(sizeof(*block_ctx->datav) +
-                                               sizeof(*block_ctx->pagev),
-                                        num_pages, GFP_NOFS);
+       size = sizeof(*block_ctx->datav) + sizeof(*block_ctx->pagev);
+       block_ctx->mem_to_free = kcalloc(num_pages, size, GFP_NOFS);
        if (!block_ctx->mem_to_free)
                return -ENOMEM;
        block_ctx->datav = block_ctx->mem_to_free;