diff mbox series

[6/8] shmat01: Fix uninitialized var error

Message ID 20210622113514.22284-7-rpalethorpe@suse.com
State Accepted
Headers show
Series Fix uninitialized var errors | expand

Commit Message

Richard Palethorpe June 22, 2021, 11:35 a.m. UTC
The compiler is confused by SAFE_WAITPID which it thinks will return
after an error. Setting status to zero silences the error.

Signed-off-by: Richard Palethorpe <rpalethorpe@suse.com>
---
 testcases/kernel/syscalls/ipc/shmat/shmat01.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/testcases/kernel/syscalls/ipc/shmat/shmat01.c b/testcases/kernel/syscalls/ipc/shmat/shmat01.c
index f75914799..606bdd154 100644
--- a/testcases/kernel/syscalls/ipc/shmat/shmat01.c
+++ b/testcases/kernel/syscalls/ipc/shmat/shmat01.c
@@ -82,7 +82,7 @@  static void verify_shmat(unsigned int n)
 {
 	int *addr;
 	pid_t pid;
-	int status;
+	int status = 0;
 	struct shmid_ds buf;
 
 	struct test_case_t *tc = &tcases[n];