Re: [PATCH 03/11] util/selfmap: Discard mapping on error

2021-07-13 Thread Richard Henderson
On 7/13/21 9:06 AM, Eric Blake wrote: e->dev = g_strdup(fields[3]); e->dev now contains malloc'd memory... -errors += qemu_strtou64(fields[4], NULL, 10, &e->inode); +errors |= qemu_strtou64(fields[4], NULL, 10, &e->inode); ...and if this qem

Re: [PATCH 03/11] util/selfmap: Discard mapping on error

2021-07-13 Thread Eric Blake
On Mon, Jul 12, 2021 at 02:55:27PM -0700, Richard Henderson wrote: > 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

[PATCH 03/11] util/selfmap: Discard mapping on error

2021-07-12 Thread Richard Henderson
>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 to