qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v8 02/10] scripts: add coccinelle script to use auto propagat


From: Markus Armbruster
Subject: Re: [PATCH v8 02/10] scripts: add coccinelle script to use auto propagated errp
Date: Wed, 11 Mar 2020 10:33:23 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

Vladimir Sementsov-Ogievskiy <address@hidden> writes:

> 09.03.2020 12:56, Markus Armbruster wrote:
>>> +
>>> +// Convert error clearing functions
>> Suggest: Ensure @local_err is cleared on free
>
> But there is no local_err after conversion

True.  Hmm.  What about this:

     // Convert calls to error_free(), possibly indirect
     // In addition to replacing @local_err by *errp, we have to clear *errp
     // to avoid use-after-free in the automatic error propagation.

>>> +(
>>> +-    error_free(local_err);
>>> ++    error_free_errp(errp);
>>> +|
>>> +-    error_report_err(local_err);
>>> ++    error_report_errp(errp);
>>> +|
>>> +-    error_reportf_err(local_err, args);
>>> ++    error_reportf_errp(errp, args);
>>> +|
>>> +-    warn_report_err(local_err);
>>> ++    warn_report_errp(errp);
>>> +|
>>> +-    warn_reportf_err(local_err, args);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]