forked from MIrrors/gasket-driver
drivers/staging/gasket: Use 2-factor allocator calls
As already done treewide, switch from open-coded multiplication to using 2-factor allocator helpers. Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Alex Van Damme
parent
0305c1f77f
commit
e1c8e7a804
@@ -1697,9 +1697,9 @@ static int gasket_mmap(struct file *filp, struct vm_area_struct *vma)
|
||||
return -EPERM;
|
||||
}
|
||||
num_map_regions = bar_desc->num_mappable_regions;
|
||||
map_regions = kzalloc(
|
||||
num_map_regions * sizeof(*bar_desc->mappable_regions),
|
||||
GFP_KERNEL);
|
||||
map_regions = kcalloc(num_map_regions,
|
||||
sizeof(*bar_desc->mappable_regions),
|
||||
GFP_KERNEL);
|
||||
if (map_regions) {
|
||||
memcpy(map_regions, bar_desc->mappable_regions,
|
||||
num_map_regions *
|
||||
|
||||
Reference in New Issue
Block a user