提交 282572b5 编写于 作者: D Dan Carpenter 提交者: Takashi Iwai

ALSA: riptide: clean up while loop

If getpaths() returned an odd number this would be a buffer under-run and an
endless loop.  It turns out that getpaths() can only return even numbers, but
let's make it easy for people auditing code.  With the new code you don't
need to look at getpaths().

This silences a smatch warning.
Signed-off-by: NDan Carpenter <error27@gmail.com>
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 e61e642c
无相关合并请求
......@@ -1974,9 +1974,9 @@ snd_riptide_proc_read(struct snd_info_entry *entry,
}
snd_iprintf(buffer, "Paths:\n");
i = getpaths(cif, p);
while (i--) {
snd_iprintf(buffer, "%x->%x ", p[i - 1], p[i]);
i--;
while (i >= 2) {
i -= 2;
snd_iprintf(buffer, "%x->%x ", p[i], p[i + 1]);
}
snd_iprintf(buffer, "\n");
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部