From: Takashi Iwai <tiwai@suse.de>
To: Roel Kluin <12o3l@tiscali.nl>
Cc: perex@perex.cz, alsa-devel@alsa-project.org,
lkml <linux-kernel@vger.kernel.org>
Subject: Re: [alsa-devel] [PATCH 6/6] sound/drivers/dummy.c: fix negative snd_pcm_format_width() check
Date: Wed, 16 Apr 2008 18:31:38 +0200 [thread overview]
Message-ID: <s5hiqyhep79.wl%tiwai@suse.de> (raw)
In-Reply-To: <48062751.8040309@tiscali.nl>
At Wed, 16 Apr 2008 18:20:33 +0200,
Roel Kluin wrote:
>
> bps is unsigned, a negative snd_pcm_format_width() return value is not noticed
>
> Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
Applied to ALSA tree. Thanks.
Takashi
> ---
> diff --git a/sound/drivers/dummy.c b/sound/drivers/dummy.c
> index a240eae..1c88977 100644
> --- a/sound/drivers/dummy.c
> +++ b/sound/drivers/dummy.c
> @@ -230,13 +230,14 @@ static int snd_card_dummy_pcm_prepare(struct snd_pcm_substream *substream)
> {
> struct snd_pcm_runtime *runtime = substream->runtime;
> struct snd_dummy_pcm *dpcm = runtime->private_data;
> - unsigned int bps;
> + int bps;
> +
> + bps = snd_pcm_format_width(runtime->format) * runtime->rate *
> + runtime->channels / 8;
>
> - bps = runtime->rate * runtime->channels;
> - bps *= snd_pcm_format_width(runtime->format);
> - bps /= 8;
> if (bps <= 0)
> return -EINVAL;
> +
> dpcm->pcm_bps = bps;
> dpcm->pcm_jiffie = bps / HZ;
> dpcm->pcm_size = snd_pcm_lib_buffer_bytes(substream);
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>
next prev parent reply other threads:[~2008-04-16 16:31 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-16 1:39 [PATCH 1/6] MIPS: irixelf: fix test unsigned var < 0 Roel Kluin
2008-04-16 15:27 ` Roel Kluin
2008-04-16 15:32 ` [PATCH 4/6] RTC: rtc-ds1374: fix unsigned new_alarm test Roel Kluin
2008-04-18 21:58 ` Alessandro Zummo
2008-04-16 16:00 ` [PATCH 5/6] NETFILTER: signed tcphoff for ipv6_skip_exthdr() retval Roel Kluin
2008-04-21 12:24 ` [netfilter-core] " Patrick McHardy
2008-04-16 16:20 ` [PATCH 6/6] sound/drivers/dummy.c: fix negative snd_pcm_format_width() check Roel Kluin
2008-04-16 16:31 ` Takashi Iwai [this message]
2008-04-16 18:00 ` [PATCH 1/6] MIPS: irixelf: fix test unsigned var < 0 Ralf Baechle
2008-04-16 19:39 ` Marcin Slusarz
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=s5hiqyhep79.wl%tiwai@suse.de \
--to=tiwai@suse.de \
--cc=12o3l@tiscali.nl \
--cc=alsa-devel@alsa-project.org \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
/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®