summaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2018-07-04 19:29:08 +0200
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>2018-07-18 12:29:11 +0200
commite78fd3c3eead7cb71c4b3bbcefbaa26a9345c0ee (patch)
treee55c57d396afbb5dadc9651fe3e283807e4c49c3 /drivers/platform
parentplatform/x86: asus-wireless: Fix uninitialized symbol usage (diff)
downloadlinux-e78fd3c3eead7cb71c4b3bbcefbaa26a9345c0ee.tar.xz
linux-e78fd3c3eead7cb71c4b3bbcefbaa26a9345c0ee.zip
platform/mellanox: Use 2-factor allocator calls
As already done treewide, switch from open-coded multiplication to using 2-factor allocation helpers. Signed-off-by: Kees Cook <keescook@chromium.org> Acked-by: Vadim Pasternak <vadimp@mellanox.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/mellanox/mlxreg-io.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/platform/mellanox/mlxreg-io.c b/drivers/platform/mellanox/mlxreg-io.c
index c192dfe6bd65..acfaf64ffde6 100644
--- a/drivers/platform/mellanox/mlxreg-io.c
+++ b/drivers/platform/mellanox/mlxreg-io.c
@@ -152,8 +152,8 @@ static int mlxreg_io_attr_init(struct mlxreg_io_priv_data *priv)
{
int i;
- priv->group.attrs = devm_kzalloc(&priv->pdev->dev,
- priv->pdata->counter *
+ priv->group.attrs = devm_kcalloc(&priv->pdev->dev,
+ priv->pdata->counter,
sizeof(struct attribute *),
GFP_KERNEL);
if (!priv->group.attrs)