diff options
author | Dan Carpenter | 2014-12-12 20:27:03 +0100 |
---|---|---|
committer | Takashi Iwai | 2014-12-15 10:03:21 +0100 |
commit | 5580ba7bf61a6047a8b95459a9ed893f01947737 (patch) | |
tree | 2e43097b2912444d3a42803058a4eb93c7f69823 /sound/firewire/oxfw/oxfw-stream.c | |
parent | ALSA: oxfw: fix detect_loud_models() return value (diff) | |
download | kernel-qcow2-linux-5580ba7bf61a6047a8b95459a9ed893f01947737.tar.gz kernel-qcow2-linux-5580ba7bf61a6047a8b95459a9ed893f01947737.tar.xz kernel-qcow2-linux-5580ba7bf61a6047a8b95459a9ed893f01947737.zip |
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>
Diffstat (limited to 'sound/firewire/oxfw/oxfw-stream.c')
-rw-r--r-- | sound/firewire/oxfw/oxfw-stream.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/firewire/oxfw/oxfw-stream.c b/sound/firewire/oxfw/oxfw-stream.c index b77cf80f1678..bda845afb470 100644 --- a/sound/firewire/oxfw/oxfw-stream.c +++ b/sound/firewire/oxfw/oxfw-stream.c @@ -61,7 +61,8 @@ static int set_stream_format(struct snd_oxfw *oxfw, struct amdtp_stream *s, u8 **formats; struct snd_oxfw_stream_formation formation; enum avc_general_plug_dir dir; - unsigned int i, err, len; + unsigned int len; + int i, err; if (s == &oxfw->tx_stream) { formats = oxfw->tx_stream_formats; |