* [patch] ALSA: pcm: harmless underflow issue in snd_pcm_sw_params()
@ 2015-10-13 7:07 Dan Carpenter
2015-10-13 9:39 ` Takashi Iwai
0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2015-10-13 7:07 UTC (permalink / raw)
To: Jaroslav Kysela
Cc: Takashi Iwai, Pierre-Louis Bossart, alsa-devel, kernel-janitors
"params->tstamp_mode" is a user supplied int. We cap the maximum but
allow negative values by mistake. It's harmless but static checkers
complain.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index 75888dd..4863af5 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -650,7 +650,8 @@ static int snd_pcm_sw_params(struct snd_pcm_substream *substream,
}
snd_pcm_stream_unlock_irq(substream);
- if (params->tstamp_mode > SNDRV_PCM_TSTAMP_LAST)
+ if (params->tstamp_mode < 0 ||
+ params->tstamp_mode > SNDRV_PCM_TSTAMP_LAST)
return -EINVAL;
if (params->proto >= SNDRV_PROTOCOL_VERSION(2, 0, 12) &&
params->tstamp_type > SNDRV_PCM_TSTAMP_TYPE_LAST)
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [patch] ALSA: pcm: harmless underflow issue in snd_pcm_sw_params()
2015-10-13 7:07 [patch] ALSA: pcm: harmless underflow issue in snd_pcm_sw_params() Dan Carpenter
@ 2015-10-13 9:39 ` Takashi Iwai
2015-10-13 12:06 ` Dan Carpenter
0 siblings, 1 reply; 3+ messages in thread
From: Takashi Iwai @ 2015-10-13 9:39 UTC (permalink / raw)
To: Dan Carpenter; +Cc: alsa-devel, kernel-janitors, Pierre-Louis Bossart
On Tue, 13 Oct 2015 09:07:56 +0200,
Dan Carpenter wrote:
>
> "params->tstamp_mode" is a user supplied int. We cap the maximum but
> allow negative values by mistake. It's harmless but static checkers
> complain.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
You already sent the same fix and it was applied in the commit
145d92e77e6f.
thanks,
Takashi
>
> diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
> index 75888dd..4863af5 100644
> --- a/sound/core/pcm_native.c
> +++ b/sound/core/pcm_native.c
> @@ -650,7 +650,8 @@ static int snd_pcm_sw_params(struct snd_pcm_substream *substream,
> }
> snd_pcm_stream_unlock_irq(substream);
>
> - if (params->tstamp_mode > SNDRV_PCM_TSTAMP_LAST)
> + if (params->tstamp_mode < 0 ||
> + params->tstamp_mode > SNDRV_PCM_TSTAMP_LAST)
> return -EINVAL;
> if (params->proto >= SNDRV_PROTOCOL_VERSION(2, 0, 12) &&
> params->tstamp_type > SNDRV_PCM_TSTAMP_TYPE_LAST)
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch] ALSA: pcm: harmless underflow issue in snd_pcm_sw_params()
2015-10-13 9:39 ` Takashi Iwai
@ 2015-10-13 12:06 ` Dan Carpenter
0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2015-10-13 12:06 UTC (permalink / raw)
To: Takashi Iwai
Cc: Jaroslav Kysela, alsa-devel, Pierre-Louis Bossart,
kernel-janitors
On Tue, Oct 13, 2015 at 11:39:41AM +0200, Takashi Iwai wrote:
> On Tue, 13 Oct 2015 09:07:56 +0200,
> Dan Carpenter wrote:
> >
> > "params->tstamp_mode" is a user supplied int. We cap the maximum but
> > allow negative values by mistake. It's harmless but static checkers
> > complain.
> >
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> You already sent the same fix and it was applied in the commit
> 145d92e77e6f.
>
Oops. Sorry about that.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-10-13 12:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-13 7:07 [patch] ALSA: pcm: harmless underflow issue in snd_pcm_sw_params() Dan Carpenter
2015-10-13 9:39 ` Takashi Iwai
2015-10-13 12:06 ` Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox