Skip to content

Commit

Permalink
bus: ti-sysc: Use 2-factor allocator arguments
Browse files Browse the repository at this point in the history
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: Kees Cook <keescook@chromium.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
  • Loading branch information
Kees Cook authored and Tony Lindgren committed Jul 2, 2018
1 parent ce397d2 commit 2074905
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/bus/ti-sysc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 2074905

Please sign in to comment.