public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Colin King <colin.king@canonical.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	alsa-devel@alsa-project.org, kernel-janitors@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH][next] ASoC: rsnd: check for zero node count
Date: Wed, 2 Jun 2021 14:21:35 +0300	[thread overview]
Message-ID: <20210602112135.GF1955@kadam> (raw)
In-Reply-To: <20210602103722.12128-1-colin.king@canonical.com>

On Wed, Jun 02, 2021 at 11:37:22AM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The call to rsnd_node_count can potentially return a zero node count
> so add a check for this corner case. (Note that the two other calls
> to rsnd_node_count in the kernel perform this check, so I think it
> justifies adding this). This avoids using a zero nr in a devm_kcalloc
> call.

I don't have a problem with the patch, but really the code works fine
as is.  A better commit message is:

  Most callers of_get_child_count() check that "nr" is non-zero so it
  causes a static checker warning when we don't do that here.  This
  doesn't cause a problem or a crash, but having zero SSUIes (What's
  plural of ssui?) doesn't make sense either so let's add a check.

regards,
dan carpenter


  reply	other threads:[~2021-06-02 11:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-02 10:37 [PATCH][next] ASoC: rsnd: check for zero node count Colin King
2021-06-02 11:21 ` Dan Carpenter [this message]
2021-06-02 22:19   ` Kuninori Morimoto
2021-06-03 10:44   ` Colin Ian King

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=20210602112135.GF1955@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=colin.king@canonical.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.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