qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] error: Fix "Converting to ERRP_GUARD()" doc on "valid at return"
@ 2021-01-25 13:26 Markus Armbruster
  2021-01-25 13:54 ` Vladimir Sementsov-Ogievskiy
  2021-01-25 15:07 ` Philippe Mathieu-Daudé
  0 siblings, 2 replies; 3+ messages in thread
From: Markus Armbruster @ 2021-01-25 13:26 UTC (permalink / raw)
  To: qemu-devel; +Cc: vsementsov

Setting errp = NULL is wrong: the automatic error propagation still
propagates the dangling pointer _auto_errp_prop.local_err.  We need to
set *errp = NULL to clear the dangling pointer.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 include/qapi/error.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/qapi/error.h b/include/qapi/error.h
index eaa05c4837..4a9260b0cc 100644
--- a/include/qapi/error.h
+++ b/include/qapi/error.h
@@ -235,7 +235,7 @@
  *    error_propagate_prepend(errp, *errp, ...) by error_prepend(errp, ...)
  *
  * 4. Ensure @errp is valid at return: when you destroy *errp, set
- *    errp = NULL.
+ *    *errp = NULL.
  *
  * Example:
  *
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] error: Fix "Converting to ERRP_GUARD()" doc on "valid at return"
  2021-01-25 13:26 [PATCH] error: Fix "Converting to ERRP_GUARD()" doc on "valid at return" Markus Armbruster
@ 2021-01-25 13:54 ` Vladimir Sementsov-Ogievskiy
  2021-01-25 15:07 ` Philippe Mathieu-Daudé
  1 sibling, 0 replies; 3+ messages in thread
From: Vladimir Sementsov-Ogievskiy @ 2021-01-25 13:54 UTC (permalink / raw)
  To: Markus Armbruster, qemu-devel

25.01.2021 16:26, Markus Armbruster wrote:
> Setting errp = NULL is wrong: the automatic error propagation still
> propagates the dangling pointer _auto_errp_prop.local_err.  We need to
> set *errp = NULL to clear the dangling pointer.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>

> ---
>   include/qapi/error.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/qapi/error.h b/include/qapi/error.h
> index eaa05c4837..4a9260b0cc 100644
> --- a/include/qapi/error.h
> +++ b/include/qapi/error.h
> @@ -235,7 +235,7 @@
>    *    error_propagate_prepend(errp, *errp, ...) by error_prepend(errp, ...)
>    *
>    * 4. Ensure @errp is valid at return: when you destroy *errp, set
> - *    errp = NULL.
> + *    *errp = NULL.
>    *
>    * Example:
>    *
> 


-- 
Best regards,
Vladimir


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] error: Fix "Converting to ERRP_GUARD()" doc on "valid at return"
  2021-01-25 13:26 [PATCH] error: Fix "Converting to ERRP_GUARD()" doc on "valid at return" Markus Armbruster
  2021-01-25 13:54 ` Vladimir Sementsov-Ogievskiy
@ 2021-01-25 15:07 ` Philippe Mathieu-Daudé
  1 sibling, 0 replies; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-01-25 15:07 UTC (permalink / raw)
  To: Markus Armbruster, qemu-devel; +Cc: vsementsov

On 1/25/21 2:26 PM, Markus Armbruster wrote:
> Setting errp = NULL is wrong: the automatic error propagation still
> propagates the dangling pointer _auto_errp_prop.local_err.  We need to
> set *errp = NULL to clear the dangling pointer.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  include/qapi/error.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-01-25 15:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-25 13:26 [PATCH] error: Fix "Converting to ERRP_GUARD()" doc on "valid at return" Markus Armbruster
2021-01-25 13:54 ` Vladimir Sementsov-Ogievskiy
2021-01-25 15:07 ` Philippe Mathieu-Daudé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).