[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 5/6] tests/qtest/tpm-tests: Remove unnecessary NULL checks
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH 5/6] tests/qtest/tpm-tests: Remove unnecessary NULL checks |
Date: |
Tue, 25 May 2021 16:00:49 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 |
On 5/25/21 3:44 PM, Peter Maydell wrote:
> Coverity points out that in tpm_test_swtpm_migration_test() we
> assume that src_tpm_addr and dst_tpm_addr are non-NULL (we
> pass them to tpm_util_migration_start_qemu() which will
> unconditionally dereference them) but then later explicitly
> check them for NULL. Remove the pointless checks.
>
> Fixes: Coverity CID 1432367, 1432359
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> tests/qtest/tpm-tests.c | 12 ++++--------
> 1 file changed, 4 insertions(+), 8 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
- Re: [PATCH 1/6] tests/qtest/bios-tables-test: Check for dup2() failure, (continued)
- [PATCH 2/6] tests/qtest/e1000e-test: Check qemu_recv() succeeded, Peter Maydell, 2021/05/25
- [PATCH 4/6] tests/qtest/pflash-cfi02-test: Avoid potential integer overflow, Peter Maydell, 2021/05/25
- [PATCH 3/6] tests/qtest/hd-geo-test: Fix checks on mkstemp() return value, Peter Maydell, 2021/05/25
- [PATCH 5/6] tests/qtest/tpm-tests: Remove unnecessary NULL checks, Peter Maydell, 2021/05/25
- [PATCH 6/6] tests/unit/test-vmstate: Assert that dup() and mkstemp() succeed, Peter Maydell, 2021/05/25