Module Name:    src
Committed By:   tnn
Date:           Thu Feb 13 18:06:26 UTC 2020

Modified Files:
        src/tests/dev/audio: audiotest.c

Log Message:
don't use variable 'newval' uninitialized when multiuser mode unchanged


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/dev/audio/audiotest.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/dev/audio/audiotest.c
diff -u src/tests/dev/audio/audiotest.c:1.2 src/tests/dev/audio/audiotest.c:1.3
--- src/tests/dev/audio/audiotest.c:1.2	Wed Feb 12 07:02:21 2020
+++ src/tests/dev/audio/audiotest.c	Thu Feb 13 18:06:26 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: audiotest.c,v 1.2 2020/02/12 07:02:21 martin Exp $	*/
+/*	$NetBSD: audiotest.c,v 1.3 2020/02/13 18:06:26 tnn Exp $	*/
 
 /*
  * Copyright (C) 2019 Tetsuya Isaki. All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: audiotest.c,v 1.2 2020/02/12 07:02:21 martin Exp $");
+__RCSID("$NetBSD: audiotest.c,v 1.3 2020/02/13 18:06:26 tnn Exp $");
 
 #include <errno.h>
 #include <fcntl.h>
@@ -2331,6 +2331,8 @@ test_open_multiuser(int multiuser)
 		r = SYSCTLBYNAME(mibname, NULL, NULL, &newval, sizeof(newval));
 		REQUIRED_SYS_EQ(0, r);
 		DPRINTF("  > new multiuser=%d\n", multiuser);
+	} else {
+		newval = oldval;
 	}
 
 	/* Do test */
@@ -6109,6 +6111,8 @@ test_audioctl_open_multiuser(int multius
 		r = SYSCTLBYNAME(mibname, NULL, NULL, &newval, sizeof(newval));
 		REQUIRED_SYS_EQ(0, r);
 		DPRINTF("  > new multiuser=%d\n", multiuser);
+	} else {
+		newval = oldval;
 	}
 
 	/* Do test */

Reply via email to