From: Kees Cook Date: Wed, 4 Jul 2018 17:29:08 +0000 (-0700) Subject: platform/mellanox: Use 2-factor allocator calls X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=e78fd3c3eead7cb71c4b3bbcefbaa26a9345c0ee;p=openwrt%2Fstaging%2Fblogic.git 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 Acked-by: Vadim Pasternak Signed-off-by: Andy Shevchenko --- 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)