mirror of
https://github.com/xemu-project/xemu.git
synced 2025-04-02 11:11:48 -04:00
kvm: Fix warning from static code analysis
Report from smatch: kvm-all.c:1373 kvm_init(135) warn: variable dereferenced before check 's' (see line 1360) 's' cannot by NULL (it was alloced using g_malloc0), so there is no need to check it here. Signed-off-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
This commit is contained in:
parent
6932a69b20
commit
6d1cc3210c
1 changed files with 5 additions and 7 deletions
12
kvm-all.c
12
kvm-all.c
|
@ -1409,13 +1409,11 @@ int kvm_init(void)
|
|||
return 0;
|
||||
|
||||
err:
|
||||
if (s) {
|
||||
if (s->vmfd >= 0) {
|
||||
close(s->vmfd);
|
||||
}
|
||||
if (s->fd != -1) {
|
||||
close(s->fd);
|
||||
}
|
||||
if (s->vmfd >= 0) {
|
||||
close(s->vmfd);
|
||||
}
|
||||
if (s->fd != -1) {
|
||||
close(s->fd);
|
||||
}
|
||||
g_free(s);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue