summaryrefslogtreecommitdiff
path: root/drivers/leds/leds-netxbig.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/leds/leds-netxbig.c')
-rw-r--r--drivers/leds/leds-netxbig.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/leds/leds-netxbig.c b/drivers/leds/leds-netxbig.c
index f48b1aed9b4e..62fa0de526ee 100644
--- a/drivers/leds/leds-netxbig.c
+++ b/drivers/leds/leds-netxbig.c
@@ -335,7 +335,7 @@ static int gpio_ext_get_of_pdata(struct device *dev, struct device_node *np,
return ret;
}
num_addr = ret;
- addr = devm_kzalloc(dev, num_addr * sizeof(*addr), GFP_KERNEL);
+ addr = devm_kcalloc(dev, num_addr, sizeof(*addr), GFP_KERNEL);
if (!addr)
return -ENOMEM;
@@ -355,7 +355,7 @@ static int gpio_ext_get_of_pdata(struct device *dev, struct device_node *np,
return ret;
}
num_data = ret;
- data = devm_kzalloc(dev, num_data * sizeof(*data), GFP_KERNEL);
+ data = devm_kcalloc(dev, num_data, sizeof(*data), GFP_KERNEL);
if (!data)
return -ENOMEM;
@@ -415,7 +415,7 @@ static int netxbig_leds_get_of_pdata(struct device *dev,
if (ret % 3)
return -EINVAL;
num_timers = ret / 3;
- timers = devm_kzalloc(dev, num_timers * sizeof(*timers),
+ timers = devm_kcalloc(dev, num_timers, sizeof(*timers),
GFP_KERNEL);
if (!timers)
return -ENOMEM;
@@ -444,7 +444,7 @@ static int netxbig_leds_get_of_pdata(struct device *dev,
return -ENODEV;
}
- leds = devm_kzalloc(dev, num_leds * sizeof(*leds), GFP_KERNEL);
+ leds = devm_kcalloc(dev, num_leds, sizeof(*leds), GFP_KERNEL);
if (!leds)
return -ENOMEM;
@@ -470,8 +470,8 @@ static int netxbig_leds_get_of_pdata(struct device *dev,
goto err_node_put;
mode_val =
- devm_kzalloc(dev,
- NETXBIG_LED_MODE_NUM * sizeof(*mode_val),
+ devm_kcalloc(dev,
+ NETXBIG_LED_MODE_NUM, sizeof(*mode_val),
GFP_KERNEL);
if (!mode_val) {
ret = -ENOMEM;
@@ -560,8 +560,8 @@ static int netxbig_led_probe(struct platform_device *pdev)
return ret;
}
- leds_data = devm_kzalloc(&pdev->dev,
- pdata->num_leds * sizeof(*leds_data),
+ leds_data = devm_kcalloc(&pdev->dev,
+ pdata->num_leds, sizeof(*leds_data),
GFP_KERNEL);
if (!leds_data)
return -ENOMEM;