Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Alex Elder <elder@ieee.org>
To: Dan Carpenter <dan.carpenter@linaro.org>,
	Troy Mitchell <troy.mitchell@linux.spacemit.com>
Cc: linux-sound@vger.kernel.org, spacemit@lists.linux.dev
Subject: Re: [bug report] ASoC: spacemit: add i2s support for K1 SoC
Date: Fri, 24 Oct 2025 11:06:04 -0500	[thread overview]
Message-ID: <eee35fa0-0a5f-4730-b6e4-a1b92dc5000f@ieee.org> (raw)
In-Reply-To: <aPtmbe9uoHIPfZz7@stanley.mountain>

On 10/24/25 6:43 AM, Dan Carpenter wrote:
> On Fri, Oct 24, 2025 at 07:37:51PM +0800, Troy Mitchell wrote:
>> On Fri, Oct 24, 2025 at 02:25:40PM +0300, Dan Carpenter wrote:
>>>      424         i2s->reset = devm_reset_control_get_exclusive(&pdev->dev, NULL);
>>>      425         if (IS_ERR(i2s->reset))
>>>      426                 return dev_err_probe(i2s->dev, PTR_ERR(i2s->reset),
>>>      427                                      "failed to get reset control");
>>>      428
>>>      429         dev_set_drvdata(i2s->dev, i2s);
>>>      430
>>>      431         spacemit_i2s_init_dai(i2s, &dai, res->start + SSDATR);
>>>                                             ^^^^
>>> dai is not initialized on failure.  Generally in the kernel we always
>>> check for allocation failures.  Even when they can't happen in real life.
>>> I was hoping they were going to make a rule that allocations under 4k
>>> wouldn't have to be checked but it hasn't happened yet.
>> Should I send a fix patch now, or should I wait for the maintainer to
>> revert it first, and then fix this error and send?
>>
>> Thanks for your report!
>>
> 
> You should send a follow on patch which just fixes the one issue.  If the
> maintainer wants to squash them together that's very easy to do in git.

Yes I agree, send a new patch, no point in reverting.  But I think
a fix commit is better than squashing (for what that's worth).


A very simple fix is assigning *dp to NULL in spacemit_i2s_init_dai().

         if (dp)
                 *dp = dai ? : NULL;

Also:  Why aren't you checking for spacemit_i2s_init_dai() returning
an error?  (Another--separate--suggested fix.)

					-Alex

> 
> regards,
> dan carpenter
> 
> 


  reply	other threads:[~2025-10-24 16:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-24 11:25 [bug report] ASoC: spacemit: add i2s support for K1 SoC Dan Carpenter
2025-10-24 11:37 ` Troy Mitchell
2025-10-24 11:43   ` Dan Carpenter
2025-10-24 16:06     ` Alex Elder [this message]
2025-10-27  2:50       ` Troy Mitchell

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=eee35fa0-0a5f-4730-b6e4-a1b92dc5000f@ieee.org \
    --to=elder@ieee.org \
    --cc=dan.carpenter@linaro.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=spacemit@lists.linux.dev \
    --cc=troy.mitchell@linux.spacemit.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