* [PATCH] tests/qtest/ahci: Improve error handling (NEGATIVE_RETURNS)
@ 2020-09-02 8:05 Philippe Mathieu-Daudé
2020-09-02 9:36 ` Thomas Huth
2020-09-03 14:38 ` no-reply
0 siblings, 2 replies; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-09-02 8:05 UTC (permalink / raw)
To: qemu-devel
Cc: Laurent Vivier, Thomas Huth, qemu-block,
Philippe Mathieu-Daudé,
Paolo Bonzini, John Snow
Fix an error handling issue reported by Coverity:
/qemu/tests/qtest/ahci-test.c: 1452 in prepare_iso()
1444 int fd = mkstemp(cdrom_path);
>>> CID 1432375: Error handling issues (NEGATIVE_RETURNS)
>>> "fd" is passed to a parameter that cannot be negative.
1452 ret = write(fd, patt, size);
Reported-by: Coverity (CID 1432375)
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
tests/qtest/ahci-test.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tests/qtest/ahci-test.c b/tests/qtest/ahci-test.c
index ca4294f44f3..5e1954852e7 100644
--- a/tests/qtest/ahci-test.c
+++ b/tests/qtest/ahci-test.c
@@ -1443,6 +1443,7 @@ static int prepare_iso(size_t size, unsigned char **buf, char **name)
ssize_t ret;
int fd = mkstemp(cdrom_path);
+ g_assert(fd != -1);
g_assert(buf);
g_assert(name);
patt = g_malloc(size);
--
2.26.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] tests/qtest/ahci: Improve error handling (NEGATIVE_RETURNS)
2020-09-02 8:05 [PATCH] tests/qtest/ahci: Improve error handling (NEGATIVE_RETURNS) Philippe Mathieu-Daudé
@ 2020-09-02 9:36 ` Thomas Huth
2020-09-03 14:38 ` no-reply
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Huth @ 2020-09-02 9:36 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Laurent Vivier, Paolo Bonzini, John Snow, qemu-block
On 02/09/2020 10.05, Philippe Mathieu-Daudé wrote:
> Fix an error handling issue reported by Coverity:
>
> /qemu/tests/qtest/ahci-test.c: 1452 in prepare_iso()
> 1444 int fd = mkstemp(cdrom_path);
> >>> CID 1432375: Error handling issues (NEGATIVE_RETURNS)
> >>> "fd" is passed to a parameter that cannot be negative.
> 1452 ret = write(fd, patt, size);
>
> Reported-by: Coverity (CID 1432375)
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> tests/qtest/ahci-test.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/tests/qtest/ahci-test.c b/tests/qtest/ahci-test.c
> index ca4294f44f3..5e1954852e7 100644
> --- a/tests/qtest/ahci-test.c
> +++ b/tests/qtest/ahci-test.c
> @@ -1443,6 +1443,7 @@ static int prepare_iso(size_t size, unsigned char **buf, char **name)
> ssize_t ret;
> int fd = mkstemp(cdrom_path);
>
> + g_assert(fd != -1);
Should be good enough for a qtest.
Reviewed-by: Thomas Huth <thuth@redhat.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] tests/qtest/ahci: Improve error handling (NEGATIVE_RETURNS)
2020-09-02 8:05 [PATCH] tests/qtest/ahci: Improve error handling (NEGATIVE_RETURNS) Philippe Mathieu-Daudé
2020-09-02 9:36 ` Thomas Huth
@ 2020-09-03 14:38 ` no-reply
1 sibling, 0 replies; 3+ messages in thread
From: no-reply @ 2020-09-03 14:38 UTC (permalink / raw)
To: philmd; +Cc: lvivier, thuth, qemu-block, jsnow, qemu-devel, pbonzini, philmd
Patchew URL: https://patchew.org/QEMU/20200902080552.159806-1-philmd@redhat.com/
Hi,
This series failed the docker-quick@centos7 build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.
=== TEST SCRIPT BEGIN ===
#!/bin/bash
make docker-image-centos7 V=1 NETWORK=1
time make docker-test-quick@centos7 SHOW_ENV=1 J=14 NETWORK=1
=== TEST SCRIPT END ===
Clone of 'https://git.qemu.org/git/dtc.git' into submodule path 'dtc' failed
failed to update submodule dtc
Submodule 'dtc' (https://git.qemu.org/git/dtc.git) unregistered for path 'dtc'
make[1]: *** [/var/tmp/patchew-tester-tmp-rwu0f67e/src/docker-src.2020-09-03-10.37.46.30048] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-rwu0f67e/src'
make: *** [docker-run-test-quick@centos7] Error 2
real 0m30.996s
user 0m2.113s
The full log is available at
http://patchew.org/logs/20200902080552.159806-1-philmd@redhat.com/testing.docker-quick@centos7/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-09-03 14:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-02 8:05 [PATCH] tests/qtest/ahci: Improve error handling (NEGATIVE_RETURNS) Philippe Mathieu-Daudé
2020-09-02 9:36 ` Thomas Huth
2020-09-03 14:38 ` no-reply
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.