summaryrefslogtreecommitdiffstats
path: root/drivers/bus/ti-sysc.c
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2018-06-18 19:45:49 +0200
committerTony Lindgren <tony@atomide.com>2018-07-02 13:24:44 +0200
commit207490517cf80d99f471d1b54e747eb95a4b8bea (patch)
tree8c59903c2270c5f1e2ac3042d905db8cf03d8ef0 /drivers/bus/ti-sysc.c
parentLinux 4.18-rc1 (diff)
downloadlinux-207490517cf80d99f471d1b54e747eb95a4b8bea.tar.xz
linux-207490517cf80d99f471d1b54e747eb95a4b8bea.zip
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: Kees Cook <keescook@chromium.org> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to '')
-rw-r--r--drivers/bus/ti-sysc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
index 1cc29629d238..80d60f43db56 100644
--- a/drivers/bus/ti-sysc.c
+++ b/drivers/bus/ti-sysc.c
@@ -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;