On Wed, Jul 29, 2020 at 4:22 PM Andrii Nakryiko <andr...@fb.com> wrote:
>
> Most of libbpf "constructors" on failure return ERR_PTR(err) result encoded as
> a pointer. It's a common mistake to eventually pass such malformed pointers
> into xxx__destroy()/xxx__free() "destructors". So instead of fixing up
> clean up code in selftests and user programs, handle such error pointers in
> destructors themselves. This works beautifully for NULL pointers passed to
> destructors, so might as well just work for error pointers.
>
> Suggested-by: Song Liu <songliubrav...@fb.com>
> Signed-off-by: Andrii Nakryiko <andr...@fb.com>

Acked-by: Song Liu <songliubrav...@fb.com>

Reply via email to