Commit 20749051 authored by Kees Cook's avatar Kees Cook Committed by Tony Lindgren

bus: ti-sysc: Use 2-factor allocator arguments

This adjusts the allocator calls to use 2-factor argument call style, as
done treewide already for improved defense against allocation overflows.
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent ce397d21
......@@ -169,9 +169,9 @@ static int sysc_get_clocks(struct sysc *ddata)
const char *name;
int nr_fck = 0, nr_ick = 0, i, error = 0;
ddata->clock_roles = devm_kzalloc(ddata->dev,
sizeof(*ddata->clock_roles) *
ddata->clock_roles = devm_kcalloc(ddata->dev,
SYSC_MAX_CLOCKS,
sizeof(*ddata->clock_roles),
GFP_KERNEL);
if (!ddata->clock_roles)
return -ENOMEM;
......@@ -200,8 +200,8 @@ static int sysc_get_clocks(struct sysc *ddata)
return -EINVAL;
}
ddata->clocks = devm_kzalloc(ddata->dev,
sizeof(*ddata->clocks) * ddata->nr_clocks,
ddata->clocks = devm_kcalloc(ddata->dev,
ddata->nr_clocks, sizeof(*ddata->clocks),
GFP_KERNEL);
if (!ddata->clocks)
return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment