Re: [PATCH 2/2] rv: Convert to use __free

From: Nam Cao
Date: Mon Nov 17 2025 - 10:20:35 EST


Steven Rostedt <rostedt@xxxxxxxxxxx> writes:
> On Sun, 16 Nov 2025 15:35:12 +0000
> Nam Cao <namcao@xxxxxxxxxxxxx> wrote:
>> + mon->root_d = dir;
>> + retain_and_null_ptr(dir);
>> return 0;
>
> Why the "retain_and_null_ptr() and not just:
>
> mon->root-d = no_free_ptr(dir);
> return 0;
>
> As from my understanding is that the retain_and_null_ptr() is for use of
> passing the variable to a function that will consume it. But for assigning
> to a variable, I usually just use the no_free_ptr().

I wasn't aware that no_free_ptr() exists. Gabriele has pointed this out,
and I fixed it up in v2.

Nam