From patchwork Tue Feb 19 04:27:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Ni X-Patchwork-Id: 1044423 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-tegra-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nvidia.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=nvidia.com header.i=@nvidia.com header.b="bqXFvTX4"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 443SQ24PV8z9sML for ; Tue, 19 Feb 2019 15:27:38 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726388AbfBSE11 (ORCPT ); Mon, 18 Feb 2019 23:27:27 -0500 Received: from hqemgate16.nvidia.com ([216.228.121.65]:19404 "EHLO hqemgate16.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726355AbfBSE10 (ORCPT ); Mon, 18 Feb 2019 23:27:26 -0500 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate16.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Mon, 18 Feb 2019 20:27:30 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Mon, 18 Feb 2019 20:27:25 -0800 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Mon, 18 Feb 2019 20:27:25 -0800 Received: from HQMAIL104.nvidia.com (172.18.146.11) by HQMAIL106.nvidia.com (172.18.146.12) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 19 Feb 2019 04:27:25 +0000 Received: from hqnvemgw02.nvidia.com (172.16.227.111) by HQMAIL104.nvidia.com (172.18.146.11) with Microsoft SMTP Server (TLS) id 15.0.1395.4 via Frontend Transport; Tue, 19 Feb 2019 04:27:25 +0000 Received: from niwei-ubuntu.nvidia.com (Not Verified[10.19.225.182]) by hqnvemgw02.nvidia.com with Trustwave SEG (v7, 5, 8, 10121) id ; Mon, 18 Feb 2019 20:27:25 -0800 From: Wei Ni To: , , CC: , , , , , , Wei Ni Subject: [PATCH v8 2/3] thermal: tegra: fix memory allocation Date: Tue, 19 Feb 2019 12:27:03 +0800 Message-ID: <1550550424-7979-3-git-send-email-wni@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1550550424-7979-1-git-send-email-wni@nvidia.com> References: <1550550424-7979-1-git-send-email-wni@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1550550450; bh=YyV1Q4P3M1Aaxq+b6vcrQ+iGB+gPdSAP7h/eyJwZlAo=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:X-NVConfidentiality:MIME-Version: Content-Type; b=bqXFvTX4ey8FFnWrx5rcP19AhdRywuC7rlyMXmCbKNiSaL11WnjNoYiS19b2oarnU Thdu1DeIhh+J2DFWRg+ZgnYaFOAx30j7SGBY2MiA80jDxgw/U27F8Wf3N7qOngOU6x o0eNurni0HJKh+KSEHStiiUYxhJ2lLs5i47P3Pyd/tuQ25mut863Savp4oiO/bI4/T d/u95zk/BZeegXbfO6xJbeIeD91UEAoo/U2lmCuXXKKTXrPjmQ1I8ay3zgtSnkP4e3 4i3WeRUtDhc3EzBvWQ8ppD+2jGIinEyPmSeS7QM+6EDmxNeVfLN3RMnt2h2zMtFS6I OIjuuoQM8xbFw== Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org Fix memory allocation to store the pointers to thermal_zone_device. Signed-off-by: Wei Ni Acked-by: Thierry Reding Reviewed-by: Daniel Lezcano --- drivers/thermal/tegra/soctherm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/thermal/tegra/soctherm.c b/drivers/thermal/tegra/soctherm.c index fa50484e1c84..b1ead6ea4c73 100644 --- a/drivers/thermal/tegra/soctherm.c +++ b/drivers/thermal/tegra/soctherm.c @@ -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;