瀏覽代碼

[ALSA] copy_ctl_value_from_user() warning fix

sound/core/control_compat.c: In function 'copy_ctl_value_from_user':
sound/core/control_compat.c:222: warning: 'count' may be used uninitialized in this function

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Andrew Morton 17 年之前
父節點
當前提交
5050b0921a
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      sound/core/control_compat.c

+ 2 - 1
sound/core/control_compat.c

@@ -219,7 +219,8 @@ static int copy_ctl_value_from_user(struct snd_card *card,
 				    struct snd_ctl_elem_value32 __user *data32,
 				    struct snd_ctl_elem_value32 __user *data32,
 				    int *typep, int *countp)
 				    int *typep, int *countp)
 {
 {
-	int i, type, count, size;
+	int i, type, size;
+	int uninitialized_var(count);
 	unsigned int indirect;
 	unsigned int indirect;
 
 
 	if (copy_from_user(&data->id, &data32->id, sizeof(data->id)))
 	if (copy_from_user(&data->id, &data32->id, sizeof(data->id)))