Skip to contentSkip to conversation

error: Fix "Converting to ERRP_GUARD()" doc on "valid at return"

PATCH In review Markus Armbruster 3 participants 3 messages Jan 25, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 error: Fix "Converting to ERRP_GUARD()" doc on "valid at return"

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.

---
 include/qapi/error.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/qapi/error.h +1 -1
index eaa05c4837..4a9260b0cc 100644
@@ -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:
  *
Signature · 1 line
2.26.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Markus Armbruster

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.

Quoted 18 lines
---
  include/qapi/error.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
include/qapi/error.h +1 -1
index eaa05c4837..4a9260b0cc 100644
@@ -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:
   *
Signature · 2 lines
Best regards,
Vladimir
Reviewed-by on v1 1/1
#2 lore raw
In reply to Markus Armbruster
Quoted 8 lines · Markus Armbruster

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.

---
 include/qapi/error.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)