thermal: tegra: fix memory allocation
authorWei Ni <wni@nvidia.com>
Tue, 19 Feb 2019 04:27:03 +0000 (12:27 +0800)
committerEduardo Valentin <edubezval@gmail.com>
Thu, 21 Feb 2019 01:23:37 +0000 (17:23 -0800)
Fix memory allocation to store the pointers to
thermal_zone_device.

Signed-off-by: Wei Ni <wni@nvidia.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
drivers/thermal/tegra/soctherm.c

index fa50484..b1ead6e 100644 (file)
@@ -1329,7 +1329,7 @@ static int tegra_soctherm_probe(struct platform_device *pdev)
        }
 
        tegra->thermctl_tzs = devm_kcalloc(&pdev->dev,
-                                          soc->num_ttgs, sizeof(*z),
+                                          soc->num_ttgs, sizeof(z),
                                           GFP_KERNEL);
        if (!tegra->thermctl_tzs)
                return -ENOMEM;