Skip to contentSkip to conversation

syscalls/creat06: Fix the use of unassigned variable

PATCH New Guangwen Feng 2 participants 2 messages Oct 31, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 syscalls/creat06: Fix the use of unassigned variable

---
 testcases/kernel/syscalls/creat/creat06.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
testcases/kernel/syscalls/creat/creat06.c +4 -3
index 165c1de..9c60fd0 100644
@@ -80,7 +80,6 @@ static void bad_addr_setup(int);
 
 static struct passwd *ltpuser;
 static char long_name[PATH_MAX+2];
-static const char *device;
 static int mount_flag;
 
 static struct test_case_t {
@@ -173,8 +172,10 @@ static void test6_cleanup(void)
 
 static void cleanup(void)
 {
-	if (mount_flag && tst_umount("mntpoint") < 0)
-		tst_brk(TBROK | TERRNO, "umount device:%s failed", device);
+	if (mount_flag && tst_umount("mntpoint") < 0) {
+		tst_brk(TBROK | TERRNO, "umount device:%s failed",
+			tst_device->dev);
+	}
 }
 
 static struct tst_test test = {
Signature · 1 line
1.8.4.2