Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2267718imu; Thu, 29 Nov 2018 02:11:00 -0800 (PST) X-Google-Smtp-Source: AFSGD/XS6pZkBBF4RnwMPX1mJ8pRqEBXQRkdmQBH8BK7wejASPlXsTY9uwU8sHqxLOd5MXUQPcGC X-Received: by 2002:a17:902:2862:: with SMTP id e89mr861990plb.158.1543486260470; Thu, 29 Nov 2018 02:11:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543486260; cv=none; d=google.com; s=arc-20160816; b=Tx6c7M6AC2awY1Uor8iJ6r2wrv8Gl8QLCauWK36N3iu6AOT3V3SSerRURxLTVuFKJp T7Lbzxc/nkdzNh1U/h1qgFh4wCswNqXHVnnFEQh10RLjpK94qmY5vYu571MpLbSfKPEa tbewjqwVCaxcO+RyfDVaxuy8/DdvXgGVix47lUldiOjHOMsyLipRg1cPfdODqKyWM/AY gX5VIqHF+tVEMsWdEYgCfqmFXnmpkbf9BSr4GZTEYjrz9bGFY2HYFPeoEncGxAosgIeY oooeKMPcUQZYl+2EDZUbQctJpBx14Sjk0eVEw3QSOGxmAbMfDWWVmmaiVyAT/c24bc2d 5RYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from; bh=ovUNjAWZj+GZM+npWLDzDjI681E7HEGsKDEe42kJ7JA=; b=bEYttDePODKRs8O2zi5GzmlX2kNRAP9NIAowxwYbA67lmtD918VmrnwNu/HkjLhDZ5 0mgcDEDgSWtFXGCL5eGkWJ91XiuKdAFR1QYFtjKBGFPVAEAnHXeLpLwzQki1oHoSctU7 pXiU/MMU9LHgPJNJwqQv9bSpWb5JkOthdp34cN7WfF4rf9wCO4fW1OZmqFGb0JZ3I4nx HknCjq0bot8b2MrIn+P6sp3HN7ML3VLflHJ0Pn63yphOgA2rXhctVzPbYYXhTVFo7Gkv vMuogtOkYeqYvfdXY1DzoDi1ECntzTIIzCUxngnfNg3yS9JY1rNsMhQXXOGi+DNzTJ9D gVfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b="faFj/E/1"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d195si1780303pfd.93.2018.11.29.02.10.44; Thu, 29 Nov 2018 02:11:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b="faFj/E/1"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727954AbeK2VOu (ORCPT + 99 others); Thu, 29 Nov 2018 16:14:50 -0500 Received: from hqemgate16.nvidia.com ([216.228.121.65]:2683 "EHLO hqemgate16.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726621AbeK2VOt (ORCPT ); Thu, 29 Nov 2018 16:14:49 -0500 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate16.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Thu, 29 Nov 2018 02:10:06 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Thu, 29 Nov 2018 02:10:00 -0800 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Thu, 29 Nov 2018 02:10:00 -0800 Received: from HQMAIL109.nvidia.com (172.20.187.15) by HQMAIL105.nvidia.com (172.20.187.12) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 29 Nov 2018 10:09:59 +0000 Received: from HQMAIL103.nvidia.com (172.20.187.11) by HQMAIL109.nvidia.com (172.20.187.15) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 29 Nov 2018 10:09:59 +0000 Received: from hqnvemgw02.nvidia.com (172.16.227.111) by HQMAIL103.nvidia.com (172.20.187.11) with Microsoft SMTP Server (TLS) id 15.0.1395.4 via Frontend Transport; Thu, 29 Nov 2018 10:09:59 +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 ; Thu, 29 Nov 2018 02:09:58 -0800 From: Wei Ni To: , , CC: , , , , Wei Ni Subject: [PATCH v4 2/3] thermal: tegra: fix memory allocation Date: Thu, 29 Nov 2018 18:09:42 +0800 Message-ID: <1543486183-2868-3-git-send-email-wni@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1543486183-2868-1-git-send-email-wni@nvidia.com> References: <1543486183-2868-1-git-send-email-wni@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1543486206; bh=ovUNjAWZj+GZM+npWLDzDjI681E7HEGsKDEe42kJ7JA=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:X-NVConfidentiality:MIME-Version: Content-Type; b=faFj/E/1RZHrdduhyLWcb2RGDpyfBMJurAr041mbI/LJMcg2Bef6fMoRkrU1NoMC1 4j7k0+GH8Wt03Y3FkyDJqHnjNRmE71UU8vezo8NnyZkeAN7EEOed+z32q73IiJYTho jmj4srOFVJqltg9Z2Prf+33TdZUVSda2FaI148VY6AmxD3oiRkPkzGQafRsxlVLEj3 FNpaRjTIj8WVwAH/IulXrRPLm0S6TZuvtV9hDbAu/sz6xGZN9VqRolJoiGcSG+ncE4 0ZPMuI2OBV7dpUfNifhX9db/jvv4jxqIs29f6jNNQVT3uo0jqzkxUWPXIWTFcmLq01 SV/qSFHPpRM5Q== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix memory allocation to store the pointers to thermal_zone_device. Signed-off-by: Wei Ni Acked-by: Thierry Reding --- 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 55cc1f2f6a45..375cadbc24cd 100644 --- a/drivers/thermal/tegra/soctherm.c +++ b/drivers/thermal/tegra/soctherm.c @@ -1339,7 +1339,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; -- 2.7.4