treewide: Replace more open-coded allocation size multiplications
As done treewide earlier, this catches several more open-coded allocation size calculations that were added to the kernel during the merge window. This performs the following mechanical transformations using Coccinelle: kvmalloc(a * b, ...) -> kvmalloc_array(a, b, ...) kvzalloc(a * b, ...) -> kvcalloc(a, b, ...) devm_kzalloc(..., a * b, ...) -> devm_kcalloc(..., a, b, ...) Signed-off-by: Kees Cook <keescook@chromium.org>
This commit is contained in:
@@ -153,8 +153,8 @@ int msm_dss_parse_clock(struct platform_device *pdev,
|
||||
return 0;
|
||||
}
|
||||
|
||||
mp->clk_config = devm_kzalloc(&pdev->dev,
|
||||
sizeof(struct dss_clk) * num_clk,
|
||||
mp->clk_config = devm_kcalloc(&pdev->dev,
|
||||
num_clk, sizeof(struct dss_clk),
|
||||
GFP_KERNEL);
|
||||
if (!mp->clk_config)
|
||||
return -ENOMEM;
|
||||
|
Reference in New Issue
Block a user