From patchwork Wed Aug 17 05:43:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Farber, Eliav" X-Patchwork-Id: 12945486 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E511EC32771 for ; Wed, 17 Aug 2022 05:44:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238783AbiHQFox (ORCPT ); Wed, 17 Aug 2022 01:44:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238610AbiHQFoQ (ORCPT ); Wed, 17 Aug 2022 01:44:16 -0400 Received: from smtp-fw-9102.amazon.com (smtp-fw-9102.amazon.com [207.171.184.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B9B27CB6C; Tue, 16 Aug 2022 22:44:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1660715040; x=1692251040; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=9K9d4IjBMmcloaT+QG5eIvNYUR3xOoTYrU9248uTcL8=; b=dQZK134ka3Ye9p+j7oDTxSvDCKdwcW2fvQXwVPHcJcH2ubl1uZTgN/Lf hEKiMIVFXfEeB8hRcdD2Ay5lZ3F6R86AomeCND1/ASODY78BJ363KMoH+ EvN+Dh7mA0XJvWGN+BOechV6cdWpy/32862sdTQjKCYbhSFxCBJ6BfiVs Q=; X-IronPort-AV: E=Sophos;i="5.93,242,1654560000"; d="scan'208";a="249710571" Received: from pdx4-co-svc-p1-lb2-vlan2.amazon.com (HELO email-inbound-relay-iad-1a-b09d0114.us-east-1.amazon.com) ([10.25.36.210]) by smtp-border-fw-9102.sea19.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Aug 2022 05:43:45 +0000 Received: from EX13MTAUWA001.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan3.iad.amazon.com [10.40.163.38]) by email-inbound-relay-iad-1a-b09d0114.us-east-1.amazon.com (Postfix) with ESMTPS id BD6208151C; Wed, 17 Aug 2022 05:43:42 +0000 (UTC) Received: from EX19D013UWA004.ant.amazon.com (10.13.138.207) by EX13MTAUWA001.ant.amazon.com (10.43.160.58) with Microsoft SMTP Server (TLS) id 15.0.1497.38; Wed, 17 Aug 2022 05:43:22 +0000 Received: from EX13MTAUWA001.ant.amazon.com (10.43.160.58) by EX19D013UWA004.ant.amazon.com (10.13.138.207) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.1118.12; Wed, 17 Aug 2022 05:43:22 +0000 Received: from dev-dsk-farbere-1a-46ecabed.eu-west-1.amazon.com (172.19.116.181) by mail-relay.amazon.com (10.43.160.118) with Microsoft SMTP Server id 15.0.1497.38 via Frontend Transport; Wed, 17 Aug 2022 05:43:22 +0000 Received: by dev-dsk-farbere-1a-46ecabed.eu-west-1.amazon.com (Postfix, from userid 14301484) id 6F16B4C4F; Wed, 17 Aug 2022 05:43:21 +0000 (UTC) From: Eliav Farber To: , , , , , , CC: , , , , , , , , , , , , Subject: [PATCH v2 02/16] hwmon: (mr75203) update pvt->v_num to the actual number of used sensors Date: Wed, 17 Aug 2022 05:43:07 +0000 Message-ID: <20220817054321.6519-3-farbere@amazon.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220817054321.6519-1-farbere@amazon.com> References: <20220817054321.6519-1-farbere@amazon.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org This issue is relevant when intel,vm-map is set, and defines a lower number of VMs than actually supported. This change is needed for all places that use pvt->v_num later on in the code. Signed-off-by: Eliav Farber --- drivers/hwmon/mr75203.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/hwmon/mr75203.c b/drivers/hwmon/mr75203.c index 0e29877a1a9c..f89f7bb5d698 100644 --- a/drivers/hwmon/mr75203.c +++ b/drivers/hwmon/mr75203.c @@ -605,6 +605,7 @@ static int mr75203_probe(struct platform_device *pdev) break; vm_num = i; + pvt->v_num = i; } in_config = devm_kcalloc(dev, vm_num + 1,