summary refs log tree commit diff stats
path: root/scripts/qapi/common.py
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2021-07-12 18:39:06 +0000
committerRichard Henderson <richard.henderson@linaro.org>2021-07-26 07:06:49 -1000
commit53645dc4cb7b74db3507558c01612c3e5ea430ab (patch)
treeabbdb773a64edd890fc35bb3378bacda178cce48 /scripts/qapi/common.py
parent2521c775bdfc8150396c4cb173b54d51f44c207e (diff)
downloadfocaccia-qemu-53645dc4cb7b74db3507558c01612c3e5ea430ab.tar.gz
focaccia-qemu-53645dc4cb7b74db3507558c01612c3e5ea430ab.zip
util/selfmap: Discard mapping on error
From clang-13:
util/selfmap.c:26:21: error: variable 'errors' set but not used \
    [-Werror,-Wunused-but-set-variable]

Quite right of course, but there's no reason not to check errors.

First, incrementing errors is incorrect, because qemu_strtoul
returns an errno not a count -- just or them together so that
we have a non-zero value at the end.

Second, if we have an error, do not add the struct to the list,
but free it instead.

Cc: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'scripts/qapi/common.py')
0 files changed, 0 insertions, 0 deletions