提交 9980c620 编写于 作者: R Roel Kluin 提交者: Takashi Iwai

ALSA: test off by one in setsamplerate()

With `while (i++ < MAX_WRITE_RETRY)' i reaches MAX_WRITE_RETRY + 1 after the loop
Signed-off-by: NRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 dfb12eeb
无相关合并请求
......@@ -1058,7 +1058,7 @@ setsamplerate(struct cmdif *cif, unsigned char *intdec, unsigned int rate)
rptr.retwords[2] != M &&
rptr.retwords[3] != N &&
i++ < MAX_WRITE_RETRY);
if (i == MAX_WRITE_RETRY) {
if (i > MAX_WRITE_RETRY) {
snd_printdd("sent samplerate %d: %d failed\n",
*intdec, rate);
return -EIO;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部