Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1867207imu; Fri, 14 Dec 2018 01:51:13 -0800 (PST) X-Google-Smtp-Source: AFSGD/XOTwl77YVqedWrie9w2hyviwbF2r2e0fk0W+5nbGdgzCmzb0dje7tlYnjgPfRC1y55EdpX X-Received: by 2002:a63:24c2:: with SMTP id k185mr2026135pgk.406.1544781073310; Fri, 14 Dec 2018 01:51:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544781073; cv=none; d=google.com; s=arc-20160816; b=hWaCrrljwsuTqHHHg38w2SwV/QoT8LupghIVbZiqGq+lN+UccVxAcLJ9z4qcLIlwJu 4tU0dRTHlscgcx0ujvQXaK4RMk7PMtXS+4LyqbnbjVvEf0AGTtA0ldw4e31U7qAQMoIz FlXiLblDkb9Klex1s5mhvMf+o1v3XyynMBQ6MUM45yv5Zv6FPEOAkThWx1jNgdVkOkOg pCoAX979fCwQzX8MCE+s/vIuEA5dV0ejFSFKMmWL8vdJQmsPeC9w9YY1ll7C6+HRzbXX RetRG8Ua1U/sBmNGYoAIX6hQjcpl/Iu5iS9eaLWHE9EfhP28/1xu6i9szb3f7e+M+Uwj aImg== 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=mfJ0UbyhFDpIIbPv2Zct+34m55gu5ZXsTwWqKRVEna8=; b=MUoAFcOZRVbZ5fVrx06M4y9p4OVPEZ/00fA43YsqoS3hl7FB5ZNBBf/vuzOsFXeiw7 YvdgolLj3sngZoThT/gF/Oi7+S5iRF2SfJARbyLFiL6p683vQa/JUJGpE+tKxERaP/88 0LjlV3b6eikjXmIwqlWyIGU/MzLEF3Te9BTnb2W5CXMIXbg8hA/5gq5LbJp7t8Rl10lU +NT/3j2zr3TbO7tWrG5JGUm02fvcq/QTuZfBFZZRnnB3uZ2bqGV/RO+7N65WFGpZ+MNe xPls1vzrvtg1FT1EW3neqBOggsdMOp4XPLhTt+axxTT4XOqM5jgiUVVgwVh3ReQwUY5i JhTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=LjlF08BO; 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 s8si3444913pgm.508.2018.12.14.01.50.57; Fri, 14 Dec 2018 01:51:13 -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=LjlF08BO; 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 S1729297AbeLNJuF (ORCPT + 99 others); Fri, 14 Dec 2018 04:50:05 -0500 Received: from hqemgate14.nvidia.com ([216.228.121.143]:16068 "EHLO hqemgate14.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729184AbeLNJuD (ORCPT ); Fri, 14 Dec 2018 04:50:03 -0500 Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by hqemgate14.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Fri, 14 Dec 2018 01:49:59 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate102.nvidia.com (PGP Universal service); Fri, 14 Dec 2018 01:50:03 -0800 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Fri, 14 Dec 2018 01:50:03 -0800 Received: from HQMAIL106.nvidia.com (172.18.146.12) by HQMAIL108.nvidia.com (172.18.146.13) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 14 Dec 2018 09:50:03 +0000 Received: from hqnvemgw02.nvidia.com (172.16.227.111) by HQMAIL106.nvidia.com (172.18.146.12) with Microsoft SMTP Server (TLS) id 15.0.1395.4 via Frontend Transport; Fri, 14 Dec 2018 09:50:02 +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 ; Fri, 14 Dec 2018 01:50:02 -0800 From: Wei Ni To: , CC: , , , , , Wei Ni Subject: [PATCH v6 2/4] thermal: tegra: fix memory allocation Date: Fri, 14 Dec 2018 17:49:51 +0800 Message-ID: <1544780993-20744-3-git-send-email-wni@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544780993-20744-1-git-send-email-wni@nvidia.com> References: <1544780993-20744-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=1544780999; bh=mfJ0UbyhFDpIIbPv2Zct+34m55gu5ZXsTwWqKRVEna8=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:X-NVConfidentiality:MIME-Version: Content-Type; b=LjlF08BO4piEWE7u6vH44xOoIvtfEz/igU/J6hk+lxgdXGntPogjngntfAp7rbIPF K+IZOsalhBP5/BcWEjv7EC2am9mAi6NPJnHtY13wu46hn1DiVX8Gg5NkzKPG/0MUxT INO2ljoPQKpBe4g7HZh+txiRHPrba+1VZnCZoUNB3XtDzjomuoIFhFsY9OiSCp41MT 15/rHkxW/H8iJ7d38Qek8AQCGuc7SEWkNewRQTWLcGmZ1T1JpXiwY4Y3wwh7Iy7a7I SUavPGjsftM9HAqfbXM7XrQmfdsIaN6RmsMc0tIxZOrUlZ5IGrdnHqLn8JPeKs8rSf lcG2X/4e9t9aQ== 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 f07de8258e93..fd2703c0cfc5 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