From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
Peter Zijlstra <peterz@infradead.org>,
Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>,
"David S . Miller" <davem@davemloft.net>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Tzvetomir Stoyanov <tz.stoyanov@gmail.com>,
Naveen N Rao <naveen@kernel.org>,
Josh Poimboeuf <jpoimboe@kernel.org>,
Jason Baron <jbaron@akamai.com>, Ard Biesheuvel <ardb@kernel.org>,
linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org
Subject: Re: [PATCH 2/6] Provide __free(argv) for argv_split() users
Date: Sun, 5 Jan 2025 18:00:13 +0900 [thread overview]
Message-ID: <20250105180013.98eab05796c20d529df4aae8@kernel.org> (raw)
In-Reply-To: <20250104110955.GA2394@redhat.com>
On Sat, 4 Jan 2025 12:09:56 +0100
Oleg Nesterov <oleg@redhat.com> wrote:
> On 01/04, Masami Hiramatsu (Google) wrote:
> >
> > +DEFINE_FREE(argv, char **, argv_free(_T))
>
> This doesn't look right, I think we need
>
> DEFINE_FREE(argv, char **, if (_T) argv_free(_T))
Ah, yes. I misunderstood argv_free() can get NULL.
Thanks!
>
> ?
>
> From the next patch
>
> @@ -73,24 +73,20 @@ int dyn_event_release(const char *raw_command, struct dyn_event_operations *type
> struct dyn_event *pos, *n;
> char *system = NULL, *event, *p;
> int argc, ret = -ENOENT;
> - char **argv;
> + char **argv __free(argv) = NULL;
>
> argv = argv_split(GFP_KERNEL, raw_command, &argc);
> if (!argv)
> return -ENOMEM;
>
> if argv_split() returns NULL, then __free_argv() will call argv_free(NULL) ?
>
> Oleg.
>
>
--
Masami Hiramatsu (Google) <mhiramat@kernel.org>
next prev parent reply other threads:[~2025-01-05 9:00 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-03 23:01 [PATCH 0/6] kprobes: jump label: Cleanup with guard and __free Masami Hiramatsu (Google)
2025-01-03 23:01 ` [PATCH 1/6] tracing/kprobes: Fix to free objects when failed to copy a symbol Masami Hiramatsu (Google)
2025-01-03 23:01 ` [PATCH 2/6] Provide __free(argv) for argv_split() users Masami Hiramatsu (Google)
2025-01-04 6:39 ` kernel test robot
2025-01-04 6:51 ` kernel test robot
2025-01-05 9:12 ` Masami Hiramatsu
2025-01-04 11:09 ` Oleg Nesterov
2025-01-05 9:00 ` Masami Hiramatsu [this message]
2025-01-06 19:30 ` Steven Rostedt
2025-01-03 23:01 ` [PATCH 3/6] tracing: Use __free() for argv in dynevent Masami Hiramatsu (Google)
2025-01-03 23:02 ` [PATCH 4/6] tracing: Use __free() in trace_probe for cleanup Masami Hiramatsu (Google)
2025-01-03 23:02 ` [PATCH 5/6] tracing: Use __free() for kprobe events to cleanup Masami Hiramatsu (Google)
2025-01-03 23:02 ` [PATCH 6/6] tracing/kprobes: Simplify __trace_kprobe_create() by removing gotos Masami Hiramatsu (Google)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250105180013.98eab05796c20d529df4aae8@kernel.org \
--to=mhiramat@kernel.org \
--cc=anil.s.keshavamurthy@intel.com \
--cc=ardb@kernel.org \
--cc=davem@davemloft.net \
--cc=jbaron@akamai.com \
--cc=jpoimboe@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=naveen@kernel.org \
--cc=oleg@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=tz.stoyanov@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®