qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tests/qtest/tpm: Remove redundant check in the tpm_test_swtpm_test()
@ 2020-11-05 15:03 AlexChen
  2020-11-05 15:57 ` Marc-André Lureau
  2020-11-09 11:28 ` Thomas Huth
  0 siblings, 2 replies; 3+ messages in thread
From: AlexChen @ 2020-11-05 15:03 UTC (permalink / raw)
  To: stefanb, Thomas Huth, lvivier, Paolo Bonzini
  Cc: QEMU Trivial, QEMU, zhang.zhanghailiang

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>
---
 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.19.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-09 11:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-05 15:03 [PATCH] tests/qtest/tpm: Remove redundant check in the tpm_test_swtpm_test() AlexChen
2020-11-05 15:57 ` Marc-André Lureau
2020-11-09 11:28 ` Thomas Huth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).