ALSA: oxfw: some signedness bugs

This code tends to use unsigned variables by default and it causes
signedness bugs when we use negative variables for error handling.
The "i" and "j" variables are used to iterated over small positive
values and so they should be type "int".  The "len" variable doesn't
*need* to be signed but it should be signed to make the code easier to
read and audit.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Dan Carpenter
2014-12-12 22:27:03 +03:00
committed by Takashi Iwai
父節點 0d3aba30b7
當前提交 5580ba7bf6
共有 3 個文件被更改,包括 6 次插入5 次删除

查看文件

@@ -15,7 +15,7 @@ static void proc_read_formation(struct snd_info_entry *entry,
struct snd_oxfw_stream_formation formation, curr;
u8 *format;
char flag;
unsigned int i, err;
int i, err;
/* Show input. */
err = snd_oxfw_stream_get_current_formation(oxfw,