Re: [PATCH] mux: fix use-after-free and node leak in mux_get()

Markus Elfring <[email protected]>
Newsgroups org.kernel.vger.kernel-janitors,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
…
> Fix both issues by moving of_node_put(args.np) after all usage of
> args.np, and introducing a common error label "put_and_ret_err" to
> centralize node release.

I imagine that another label can become helpful also for the statement
“ret = -EINVAL;”.


>                          Also add missing of_node_put() in all error
> path.

You propose to use such a clean-up action for more cases in the implementation
of the function “mux_get”, don't you?
https://elixir.bootlin.com/linux/v7.0-rc7/source/drivers/mux/core.c#L520-L609

How do you think about to increase the application of scope-based resource management?

Regards,
Markus
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.