From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09B2EC43441 for ; Thu, 29 Nov 2018 10:10:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BBC572081B for ; Thu, 29 Nov 2018 10:10:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="faFj/E/1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BBC572081B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727973AbeK2VOu (ORCPT ); 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