[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 05/19] tests/qtest/tpm: Remove redundant check in the tpm_test_swt
From: |
Thomas Huth |
Subject: |
[PULL 05/19] tests/qtest/tpm: Remove redundant check in the tpm_test_swtpm_test() |
Date: |
Tue, 10 Nov 2020 12:11:18 +0100 |
From: AlexChen <alex.chen@huawei.com>
The 'addr' would not be NULL after checking 'succ' is valid,
and it has been dereferenced in the previous code(args = g_strdup_printf()).
So the check on 'addr' in the tpm_test_swtpm_test() is redundant. Remove it.
Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Alex Chen <alex.chen@huawei.com>
Message-Id: <5FA41448.4040404@huawei.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
tests/qtest/tpm-tests.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/tests/qtest/tpm-tests.c b/tests/qtest/tpm-tests.c
index 70c80f8379..0da3a8a4df 100644
--- a/tests/qtest/tpm-tests.c
+++ b/tests/qtest/tpm-tests.c
@@ -70,10 +70,8 @@ void tpm_test_swtpm_test(const char *src_tpm_path, tx_func
*tx,
qtest_end();
tpm_util_swtpm_kill(swtpm_pid);
- if (addr) {
- g_unlink(addr->u.q_unix.path);
- qapi_free_SocketAddress(addr);
- }
+ g_unlink(addr->u.q_unix.path);
+ qapi_free_SocketAddress(addr);
}
void tpm_test_swtpm_migration_test(const char *src_tpm_path,
--
2.18.4
- [PULL 00/19] qtests, gitlab, s390x and misc patches, Thomas Huth, 2020/11/10
- [PULL 01/19] meson: always include contrib/libvhost-user, Thomas Huth, 2020/11/10
- [PULL 03/19] device-crash-test: Check if path is actually an executable file, Thomas Huth, 2020/11/10
- [PULL 04/19] qtest: Fix bad printf format specifiers, Thomas Huth, 2020/11/10
- [PULL 05/19] tests/qtest/tpm: Remove redundant check in the tpm_test_swtpm_test(),
Thomas Huth <=
- [PULL 02/19] tests/vm: update openbsd to release 6.8, Thomas Huth, 2020/11/10
- [PULL 06/19] gitlab-ci: Drop generic cache rule, Thomas Huth, 2020/11/10
- [PULL 07/19] MAINTAINERS: Add gitlab-pipeline-status script to GitLab CI section, Thomas Huth, 2020/11/10
- [PULL 11/19] fuzz: Make fork_fuzz.ld compatible with LLVM's LLD, Thomas Huth, 2020/11/10
- [PULL 10/19] scripts/oss-fuzz: give all fuzzers -target names, Thomas Huth, 2020/11/10
- [PULL 09/19] docs/fuzz: update fuzzing documentation post-meson, Thomas Huth, 2020/11/10
- [PULL 12/19] configure: surface deprecated targets in the help output, Thomas Huth, 2020/11/10
- [PULL 13/19] gitlab: publish the docs built during CI, Thomas Huth, 2020/11/10
- [PULL 14/19] gitlab: force enable docs build in Fedora, Ubuntu, Debian, Thomas Huth, 2020/11/10
- [PULL 08/19] docs/fuzz: rST-ify the fuzzing documentation, Thomas Huth, 2020/11/10