From ea8e341682e84b04c37632ebbbc334b7ec14f582 Mon Sep 17 00:00:00 2001 From: Kulikov Vasiliy Date: Thu, 15 Jul 2010 22:48:19 +0400 Subject: [PATCH] --- yaml --- r: 206678 b: refs/heads/master c: 315e8f7501ad929acacfa94c251283e837f281ed h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/sound/pci/asihpi/asihpi.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 4bcc1ee09beb..3c6df6edd226 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 1d8c1100fbf956b9c5994077a4d3c6490c23e087 +refs/heads/master: 315e8f7501ad929acacfa94c251283e837f281ed diff --git a/trunk/sound/pci/asihpi/asihpi.c b/trunk/sound/pci/asihpi/asihpi.c index 91218f77217f..c80b0b863c54 100644 --- a/trunk/sound/pci/asihpi/asihpi.c +++ b/trunk/sound/pci/asihpi/asihpi.c @@ -460,6 +460,7 @@ static int snd_card_asihpi_pcm_hw_params(struct snd_pcm_substream *substream, struct snd_card_asihpi *card = snd_pcm_substream_chip(substream); int err; u16 format; + int width; unsigned int bytes_per_sec; print_hwparams(params); @@ -512,9 +513,10 @@ static int snd_card_asihpi_pcm_hw_params(struct snd_pcm_substream *substream, dpcm->hpi_buffer_attached); } bytes_per_sec = params_rate(params) * params_channels(params); - bytes_per_sec *= snd_pcm_format_width(params_format(params)); + width = snd_pcm_format_width(params_format(params)); + bytes_per_sec *= width; bytes_per_sec /= 8; - if (bytes_per_sec <= 0) + if (width < 0 || bytes_per_sec == 0) return -EINVAL; dpcm->bytes_per_sec = bytes_per_sec;