mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Neha Malcom Francis <n-francis@ti.com>
To: Shree Ramamoorthy <s-ramamoorthy@ti.com>, <lgirdwood@gmail.com>,
	<linux-kernel@vger.kernel.org>
Cc: <m-leonard@ti.com>, <u-kumar1@ti.com>, <bhargav.r@ltts.com>,
	<m.nirmaladevi@ltts.com>, <vigneshr@ti.com>
Subject: Re: [RESEND][PATCH] Fix nr_types assignment for TPS6594/3 and TPS65224
Date: Tue, 4 Jun 2024 07:03:59 +0530	[thread overview]
Message-ID: <85020e6a-35c8-403c-8e85-3f37902093db@ti.com> (raw)
In-Reply-To: <20240603192500.645586-1-s-ramamoorthy@ti.com>

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

      reply	other threads:[~2024-06-04  1:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-03 19:25 Shree Ramamoorthy
2024-06-04  1:33 ` Neha Malcom Francis [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=85020e6a-35c8-403c-8e85-3f37902093db@ti.com \
    --to=n-francis@ti.com \
    --cc=bhargav.r@ltts.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m-leonard@ti.com \
    --cc=m.nirmaladevi@ltts.com \
    --cc=s-ramamoorthy@ti.com \
    --cc=u-kumar1@ti.com \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®