From: AlexChen Date: Thu, 5 Nov 2020 15:03:36 +0000 (+0800) Subject: tests/qtest/tpm: Remove redundant check in the tpm_test_swtpm_test() X-Git-Tag: v5.2.0-rc1~2^2~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dccaea2514007dd526a54038ffcaef5fb9c95c0c;p=thirdparty%2Fqemu.git tests/qtest/tpm: Remove redundant check in the tpm_test_swtpm_test() 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 Signed-off-by: Alex Chen Message-Id: <5FA41448.4040404@huawei.com> Reviewed-by: Marc-André Lureau Reviewed-by: Thomas Huth Signed-off-by: Thomas Huth --- diff --git a/tests/qtest/tpm-tests.c b/tests/qtest/tpm-tests.c index 70c80f8379a..0da3a8a4df5 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,