Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp1316257lqj; Mon, 3 Jun 2024 18:34:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVmGWIXZcgRQj5J94TOOnUmIwBO+EEYlrakhnOo3II4zxfXusVpoc3S7pXNHDsdjJYuLRbYtCNf2IlY2oBys5uY3u2xZlX/fftoc/2EFA== X-Google-Smtp-Source: AGHT+IGj/BePn1vBotcdEHxcD7t1lh04hOXjX+++YRcjPgj5xTRl4gT0thwtuDIkx3asn6aLS7yT X-Received: by 2002:a17:906:6d58:b0:a67:eec:91cf with SMTP id a640c23a62f3a-a6821d62af3mr657495366b.50.1717464860020; Mon, 03 Jun 2024 18:34:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717464860; cv=pass; d=google.com; s=arc-20160816; b=qCHCStpfES/l+1HzicJXL1oLtuw7VWG6kvA8Z4auPJcE9GBD07Mc7nmaGv9xe/MsmX 0ZWsSm/Feqt91kJ6yWh+8EdTURlAdR+Jg5fudOjkXccB1d400MLrAZCzM9yRDk9foHCV yUAHQthpcwZElz2UiGO9c3Z+ayJ0qfgHYs5SUnGYvAN6edmHATwQTEuOdBq44cW0dnp9 2eOOw2WFKiBOKJYWEa5FQdC0aoRNuqTMNH3/+x+vf49Y1xTROyoOS18wCVfxMhHguywf DD0WMfnyhFpBCtgrjBsBLhtL2EHeolbveCjxTqbXN2EDRp0mycld1T00K7W6luPCxFpN QCHA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=u4JTtTFaZn1Az1/n9VAvAUmZEnh8DwZmiDEI0s+4lkM=; fh=+N+L7IRCEmkperWQP3gafYrR1yEN0bmxv9SU7qmrHwk=; b=yiE6IglID0hBgqsxY74/BapcKZHMA/ORty/vyHSNeapObPAEOUSUxYqaEVwDPaDssK hqp10HqEDBz1MV4biTjFa3cY0q7qR16R1wYXM3i9VztjdKvJ1KL+0QlhKMgXEsCdvYwS Ncs3KH8V6BH8ZXvWLlZNTXIgoySwK4CduBdQLyRurgAz2y034XzqBpBs8geEB/NKFM9A MOJsvSWJplqbrL40PaExgY5hSof3l8bnadadRF7huHuvLu4oIGbI+HmYYdjPAUQeMK+I XYOaRuGIetwNPzdeTuQe0//qcwu3f29n5oouPUq1GCJ0TTjTkkjHuN48A/sb23aMLkP9 355w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=RWZTDlRi; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-199908-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199908-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a67e73fb470si426025666b.248.2024.06.03.18.34.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 18:34:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-199908-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=RWZTDlRi; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-199908-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199908-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id BA9E71F232BB for ; Tue, 4 Jun 2024 01:34:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3DCA2139CFF; Tue, 4 Jun 2024 01:34:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="RWZTDlRi" Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 00FE713957E for ; Tue, 4 Jun 2024 01:34:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.19.141 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717464852; cv=none; b=g4It9jFfQMcM/LcfTaoneXRpPVftj8gqa4AhYrtUEc4SbVWgFX+IT1fxKvT0ThGG+a1bHeOphxPD5NZ4kvDFeQvbJMWz5+Yz2AAJDNkAqgGnDwye83P5T9+O6Ftwy7Ip25Tbx1PKX8TxfccIUgteDl0TrQcU2VAj+fjWE1DxJDM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717464852; c=relaxed/simple; bh=gU1Fx1GfKkbB7MyBjDci5PwEsJLxp6mBN0DeKWihvIs=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=ke6KAkwpcNIthQQNMDLZsdgrdOhglP+6fRqzg314FZel6vgw33tix59VcgA1/DfAOb9anj8Uzqc2IVv8fWQB0IFAxdItD226LXCU6wSmRxchs0OmgHpi5ecTsH4UrJui0z6ZZqECCvAf1p4Lzo5eAH6pkE0xPzjWzEGhm40AxWc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=RWZTDlRi; arc=none smtp.client-ip=198.47.19.141 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 4541Y3c0101001; Mon, 3 Jun 2024 20:34:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1717464843; bh=u4JTtTFaZn1Az1/n9VAvAUmZEnh8DwZmiDEI0s+4lkM=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=RWZTDlRiS97e9L10Rh9BBfXe7vooGC6NECVIZeR9QI5WBMNlF/+Vfwxe0H56IEq6z 2d9R6X5hHCqyGF+3HB2Q2Y47OWfeBDezjrrpdUUHARqtuEJHDwR9avukjw0VwKnogG 7ZwYDfkW7vyNpgMrJt4soBTP951lZ1chsw8PyZI0= Received: from DLEE104.ent.ti.com (dlee104.ent.ti.com [157.170.170.34]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 4541Y3dN098142 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 3 Jun 2024 20:34:03 -0500 Received: from DLEE105.ent.ti.com (157.170.170.35) by DLEE104.ent.ti.com (157.170.170.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Mon, 3 Jun 2024 20:34:02 -0500 Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DLEE105.ent.ti.com (157.170.170.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Mon, 3 Jun 2024 20:34:02 -0500 Received: from [10.249.139.5] ([10.249.139.5]) by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 4541XxvA123748; Mon, 3 Jun 2024 20:34:00 -0500 Message-ID: <85020e6a-35c8-403c-8e85-3f37902093db@ti.com> Date: Tue, 4 Jun 2024 07:03:59 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RESEND][PATCH] Fix nr_types assignment for TPS6594/3 and TPS65224 To: Shree Ramamoorthy , , CC: , , , , References: <20240603192500.645586-1-s-ramamoorthy@ti.com> Content-Language: en-US From: Neha Malcom Francis In-Reply-To: <20240603192500.645586-1-s-ramamoorthy@ti.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Hi Shree On 04-Jun-24 12:55 AM, Shree Ramamoorthy wrote: > Fixes: 00c826525fba ("regulator: tps6594-regulator: Add TI TPS65224 PMIC regulators") > Your fixes tag must go after the commit message, along with your Signed-off-by; see [1] [1] https://lore.kernel.org/linux-kernel/20240521094758.2190331-1-n-francis@ti.com/ > Marked as resend to include the correct Fixes: tag. > > TPS6594/3 and TPS65224's nr_types assignment were incorrectly swamped in > probe(), leading to memory underallocation and a NULL pointer error. > Error detected in and solution tested on J7200 EVM. > > Error logs: > [ 13.974024] Call trace: > [ 13.974025] _regulator_put.part.0+0x40/0x48 > [ 13.974028] regulator_register+0x2b0/0xa00 > [ 13.974031] devm_regulator_register+0x58/0xa0 > [ 13.974035] tps6594_regulator_probe+0x4e0/0x5f0 [tps6594_regulator] > ... > [ 13.974178] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000004 > --- > drivers/regulator/tps6594-regulator.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/regulator/tps6594-regulator.c b/drivers/regulator/tps6594-regulator.c > index 4a859f4c0f83..b66608ab2546 100644 > --- a/drivers/regulator/tps6594-regulator.c > +++ b/drivers/regulator/tps6594-regulator.c > @@ -660,11 +660,11 @@ static int tps6594_regulator_probe(struct platform_device *pdev) > } else if (tps->chip_id == TPS65224) { > nr_buck = ARRAY_SIZE(tps65224_buck_regs); > nr_ldo = ARRAY_SIZE(tps65224_ldo_regs); > - nr_types = REGS_INT_NB; > + nr_types = TPS65224_REGS_INT_NB; > } else { > nr_buck = ARRAY_SIZE(buck_regs); > nr_ldo = ARRAY_SIZE(tps6594_ldo_regs); > - nr_types = TPS65224_REGS_INT_NB; > + nr_types = REGS_INT_NB; > } > > reg_irq_nb = nr_types * (nr_buck + nr_ldo); Thanks for spotting this fix! -- Thanking You Neha Malcom Francis