[LTP] [PATCH] syscalls/creat06: Fix the use of unassigned variable
Guangwen Feng
fenggw-fnst@cn.fujitsu.com
Mon Oct 31 08:29:43 CET 2016
Signed-off-by: Guangwen Feng <fenggw-fnst@cn.fujitsu.com>
---
testcases/kernel/syscalls/creat/creat06.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/testcases/kernel/syscalls/creat/creat06.c b/testcases/kernel/syscalls/creat/creat06.c
index 165c1de..9c60fd0 100644
--- a/testcases/kernel/syscalls/creat/creat06.c
+++ b/testcases/kernel/syscalls/creat/creat06.c
@@ -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 = {
--
1.8.4.2
More information about the ltp
mailing list