NFS: Use kcalloc() when allocating arrays
[pandora-kernel.git] / fs / nfs / blocklayout / extents.c
index c69682a..4e2ee99 100644 (file)
@@ -153,7 +153,7 @@ static int _preload_range(struct pnfs_inval_markings *marks,
        count = (int)(end - start) / (int)tree->mtt_step_size;
 
        /* Pre-malloc what memory we might need */
-       storage = kmalloc(sizeof(*storage) * count, GFP_NOFS);
+       storage = kcalloc(count, sizeof(*storage), GFP_NOFS);
        if (!storage)
                return -ENOMEM;
        for (i = 0; i < count; i++) {