From 8097da4b6740f1e41dd28242a27d859ef5af906a Mon Sep 17 00:00:00 2001 From: tnn Date: Thu, 13 Feb 2020 18:06:26 +0000 Subject: [PATCH] don't use variable 'newval' uninitialized when multiuser mode unchanged --- tests/dev/audio/audiotest.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/dev/audio/audiotest.c b/tests/dev/audio/audiotest.c index edade7a692e8..8cc8d61b8f61 100644 --- a/tests/dev/audio/audiotest.c +++ b/tests/dev/audio/audiotest.c @@ -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 -__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 #include @@ -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 multiuser, const char *dev1, const char *dev2) r = SYSCTLBYNAME(mibname, NULL, NULL, &newval, sizeof(newval)); REQUIRED_SYS_EQ(0, r); DPRINTF(" > new multiuser=%d\n", multiuser); + } else { + newval = oldval; } /* Do test */