[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241220083829.1e1aa9d3@gandalf.local.home>
Date: Fri, 20 Dec 2024 08:38:29 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org
Cc: Masami Hiramatsu <mhiramat@...nel.org>, Mark Rutland
<mark.rutland@....com>, Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Andrew Morton <akpm@...ux-foundation.org>, Peter Zijlstra
<peterz@...radead.org>
Subject: Re: [PATCH 08/14] tracing: Switch trace_events_trigger.c code over
to use guard()
On Thu, 19 Dec 2024 15:12:06 -0500
Steven Rostedt <rostedt@...dmis.org> wrote:
> @@ -288,28 +280,22 @@ static ssize_t event_trigger_regex_write(struct file *file,
>
> buf = memdup_user_nul(ubuf, cnt);
> if (IS_ERR(buf))
> - return PTR_ERR(buf);
> + return PTR_ERR(no_free_ptr(buf));
>
I just realized that __free(kfree) is defined as:
DEFINE_FREE(kfree, void *, if (!IS_ERR_OR_NULL(_T)) kfree(_T))
where it can handle IS_ERR(), so the above doesn't need that no_free_ptr(buf).
-- Steve
Powered by blists - more mailing lists