From: Linus Walleij <linusw@kernel.org>
To: kr494167@gmail.com
Cc: Frank.Li@nxp.com, conor.dooley@microchip.com,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] pinctrl: generic: free maps on pinctrl_generic_to_map() failure
Date: Wed, 29 Jul 2026 09:50:41 +0200 [thread overview]
Message-ID: <CAD++jLmipYnkDJ+Ed4LM44zZYcqU_Q+D7BBTs-RdrY4pDCmjpw@mail.gmail.com> (raw)
In-Reply-To: <20260725022150.9214-1-kr494167@gmail.com>
On Sat, Jul 25, 2026 at 4:22 AM <kr494167@gmail.com> wrote:
> From: Surendra Singh Chouhan <kr494167@gmail.com>
>
> pinctrl_generic_to_map() parses DT configuration and allocates pinctrl
> maps via pinctrl_utils_reserve_map().
>
> If subsequent steps (such as pinctrl_utils_add_map_mux(),
> pinctrl_generic_add_group(), pinconf_generic_parse_dt_config(), or
> pinctrl_utils_add_map_configs()) return an error, *maps may contain
> partially allocated map entries. Returning the error directly without
> freeing *maps leaks the allocated mapping memory across all drivers
> that rely on pinctrl_generic_to_map().
>
> Fix this by calling pinctrl_utils_free_map() and resetting *maps,
> *num_maps, and *num_reserved_maps in the error path of
> pinctrl_generic_to_map().
>
> Fixes: aaaf31be0426 ("pinctrl: extract pinctrl_generic_to_map() from pinctrl_generic_pins_function_dt_node_to_map()")
> Signed-off-by: Surendra Singh Chouhan <kr494167@gmail.com>
This does not apply to the current "devel" branch in the pinctrl tree:
https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git/log/?h=devel
Please rebase (some things may be fixed already) and resend.
Yours,
Linus Walleij
prev parent reply other threads:[~2026-07-29 7:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-25 2:21 kr494167
2026-07-29 7:50 ` Linus Walleij [this message]
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=CAD++jLmipYnkDJ+Ed4LM44zZYcqU_Q+D7BBTs-RdrY4pDCmjpw@mail.gmail.com \
--to=linusw@kernel.org \
--cc=Frank.Li@nxp.com \
--cc=conor.dooley@microchip.com \
--cc=kr494167@gmail.com \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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®