]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/blobdiff - fs/ceph/addr.c
treewide: kmalloc() -> kmalloc_array()
[mirror_ubuntu-hirsute-kernel.git] / fs / ceph / addr.c
index 5f7ad3d0df2ea69121acded120e26d05515fd79a..c9cb2f33a6d6763f1abcce330186775d7e99eb0b 100644 (file)
@@ -370,7 +370,7 @@ static int start_read(struct inode *inode, struct ceph_rw_context *rw_ctx,
 
        /* build page vector */
        nr_pages = calc_pages_for(0, len);
-       pages = kmalloc(sizeof(*pages) * nr_pages, GFP_KERNEL);
+       pages = kmalloc_array(nr_pages, sizeof(*pages), GFP_KERNEL);
        if (!pages) {
                ret = -ENOMEM;
                goto out_put;
@@ -966,8 +966,9 @@ get_more_pages:
 
                                BUG_ON(pages);
                                max_pages = calc_pages_for(0, (u64)len);
-                               pages = kmalloc(max_pages * sizeof (*pages),
-                                               GFP_NOFS);
+                               pages = kmalloc_array(max_pages,
+                                                     sizeof(*pages),
+                                                     GFP_NOFS);
                                if (!pages) {
                                        pool = fsc->wb_pagevec_pool;
                                        pages = mempool_alloc(pool, GFP_NOFS);
@@ -1113,8 +1114,8 @@ new_request:
 
                        /* allocate new pages array for next request */
                        data_pages = pages;
-                       pages = kmalloc(locked_pages * sizeof (*pages),
-                                       GFP_NOFS);
+                       pages = kmalloc_array(locked_pages, sizeof(*pages),
+                                             GFP_NOFS);
                        if (!pages) {
                                pool = fsc->wb_pagevec_pool;
                                pages = mempool_alloc(pool, GFP_NOFS);