btrfs: cleanup, use kmalloc_array/kcalloc array helpers
Convert kmalloc(nr * size, ..) to kmalloc_array that does additional overflow checks, the zeroing variant is kcalloc. Signed-off-by: David Sterba <dsterba@suse.cz>
This commit is contained in:
@@ -298,7 +298,7 @@ static int io_ctl_init(struct io_ctl *io_ctl, struct inode *inode,
|
||||
|
||||
memset(io_ctl, 0, sizeof(struct io_ctl));
|
||||
|
||||
io_ctl->pages = kzalloc(sizeof(struct page *) * num_pages, GFP_NOFS);
|
||||
io_ctl->pages = kcalloc(num_pages, sizeof(struct page *), GFP_NOFS);
|
||||
if (!io_ctl->pages)
|
||||
return -ENOMEM;
|
||||
|
||||
|
Reference in New Issue
Block a user