alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org, Liam Girdwood <lgirdwood@gmail.com>
Subject: Re: [PATCH 6/9] ASoC: max98095: Add missing negative channel checks
Date: Wed, 30 Oct 2013 14:31:21 -0700	[thread overview]
Message-ID: <20131030213121.GN2493@sirena.org.uk> (raw)
In-Reply-To: <s5h61sek6ei.wl%tiwai@suse.de>


[-- Attachment #1.1: Type: text/plain, Size: 885 bytes --]

On Wed, Oct 30, 2013 at 06:36:21PM +0100, Takashi Iwai wrote:
> Mark Brown wrote:
> > On Wed, Oct 30, 2013 at 08:35:04AM +0100, Takashi Iwai wrote:

> > > +	if (channel < 0)
> > > +		return channel;
> > >  	BUG_ON(channel > 1);

> > This doesn't seem to fit in well with the adjacent code - the handling
> > of out of bounds data isn't consistent though it looks like they're both
> > doing essentially the same thing here.

> Actually BUG_ON(channel > 1) is a pretty stupid line and should be
> removed.  You'll see that this never happens if you read the code.

Yeah, but then nor does a return of less than zero...

> Overall, this driver has way too many BUG_ON() without
> considerations.  Such BUT_ON()'s are worse than nothing, IMO.

Yeah, I'm ambivalent.  I think they're not too bad if it's about a
fairly small part of the driver agreeing with itself which is the case
here.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



  reply	other threads:[~2013-10-30 21:31 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-30  7:34 [PATCH 0/9] ASoC: Yet another small fixes Takashi Iwai
2013-10-30  7:34 ` [PATCH 1/9] ASoC: ab8500: Add missing of NULL check of devm_kzalloc() Takashi Iwai
2013-10-30 16:33   ` Mark Brown
2013-10-30  7:35 ` [PATCH 2/9] ASoC: ab8500: Add missing return in ab8500_codec_set_dai_fmt() Takashi Iwai
2013-10-30  7:35 ` [PATCH 3/9] ASoC: ab8500: Fix invalid cast to long pointer Takashi Iwai
2013-10-30 16:34   ` Mark Brown
2013-10-30  7:35 ` [PATCH 4/9] ASoC: wm_hubs: Add missing break in hp_supply_event() Takashi Iwai
2013-10-30 16:35   ` Mark Brown
2013-10-30  7:35 ` [PATCH 5/9] ASoC: wm0010: Fix possible out-of-bounds array read Takashi Iwai
2013-10-30 16:38   ` Mark Brown
2013-10-30 17:32     ` Takashi Iwai
2013-10-30 21:32       ` Mark Brown
2013-10-30  7:35 ` [PATCH 6/9] ASoC: max98095: Add missing negative channel checks Takashi Iwai
2013-10-30 16:46   ` Mark Brown
2013-10-30 17:36     ` Takashi Iwai
2013-10-30 21:31       ` Mark Brown [this message]
2013-10-31  7:24         ` Takashi Iwai
2013-10-30  7:35 ` [PATCH 7/9] ASoC: ml26124: Fix negative array index read Takashi Iwai
2013-10-30 16:48   ` Mark Brown
2013-10-30 17:40     ` Takashi Iwai
2013-10-30 21:33       ` Mark Brown
2013-10-30  7:35 ` [PATCH 8/9] ASoC: rt5640: Fix ignored error checks Takashi Iwai
2013-10-30 16:49   ` Mark Brown
2013-10-30  7:35 ` [PATCH 9/9] ASoC: wm8996: Fix negative array index read Takashi Iwai
2013-10-30 16:51   ` Mark Brown
2013-10-30 17:33     ` Takashi Iwai

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=20131030213121.GN2493@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=lgirdwood@gmail.com \
    --cc=tiwai@suse.de \
    /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;
as well as URLs for NNTP newsgroup(s).