mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Baolin Wang <baolin.wang@linux.alibaba.com>
To: Jiale Yao <yaojiale02@163.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Linus Walleij <linusw@kernel.org>,
	Orson Zhai <orsonzhai@gmail.com>,
	Chunyan Zhang <zhang.lyra@gmail.com>,
	Thierry Reding <thierry.reding@kernel.org>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>,
	linux-renesas-soc@vger.kernel.org, linux-gpio@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org
Subject: Re: [PATCH 1/4] pinctrl: sprd: free maps on DT map failure
Date: Tue, 29 Sep 2026 14:08:49 +0800	[thread overview]
Message-ID: <bf74f2a0-bc38-44f9-a54a-2e213b78f6f6@linux.alibaba.com> (raw)
In-Reply-To: <20260924111856.622898-2-yaojiale02@163.com>



On 9/24/26 7:18 PM, Jiale Yao wrote:
> sprd_dt_node_to_map() reserves map storage before adding mux and
> configuration entries.  If a later operation fails, the error path only
> frees the temporary configurations and leaves the map allocation reachable
> through the output pointer.
> 
> Free the partially built map and clear the output parameters on failure.
> 
> Signed-off-by: Jiale Yao <yaojiale02@163.com>
> ---

LGTM. Please add the Fixes tag:

Fixes: 41d32cfce1ae ("pinctrl: sprd: Add Spreadtrum pin control driver")

Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>

>   drivers/pinctrl/sprd/pinctrl-sprd.c | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/pinctrl/sprd/pinctrl-sprd.c b/drivers/pinctrl/sprd/pinctrl-sprd.c
> index 16cf9d15f247..218ac5236e95 100644
> --- a/drivers/pinctrl/sprd/pinctrl-sprd.c
> +++ b/drivers/pinctrl/sprd/pinctrl-sprd.c
> @@ -326,6 +326,12 @@ static int sprd_dt_node_to_map(struct pinctrl_dev *pctldev,
>   
>   out:
>   	kfree(configs);
> +	if (ret < 0) {
> +		pinctrl_utils_free_map(pctldev, *map, *num_maps);
> +		*map = NULL;
> +		*num_maps = 0;
> +	}
> +
>   	return ret;
>   }
>   


  reply	other threads:[~2026-09-29  6:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-24 11:18 [PATCH 0/4] pinctrl: free maps on DT mapping failures Jiale Yao
2026-09-24 11:18 ` [PATCH 1/4] pinctrl: sprd: free maps on DT map failure Jiale Yao
2026-09-29  6:08   ` Baolin Wang [this message]
2026-09-24 11:18 ` [PATCH 2/4] pinctrl: renesas: rzn1: " Jiale Yao
2026-09-28 13:19   ` Geert Uytterhoeven
2026-09-29  8:07     ` jiale yao
2026-09-24 11:18 ` [PATCH 3/4] pinctrl: tegra: xusb: " Jiale Yao
2026-09-24 11:18 ` [PATCH 4/4] pinctrl: samsung: " Jiale Yao

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=bf74f2a0-bc38-44f9-a54a-2e213b78f6f6@linux.alibaba.com \
    --to=baolin.wang@linux.alibaba.com \
    --cc=geert+renesas@glider.be \
    --cc=jonathanh@nvidia.com \
    --cc=krzysztof.kozlowski@oss.qualcomm.com \
    --cc=linusw@kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=orsonzhai@gmail.com \
    --cc=thierry.reding@kernel.org \
    --cc=yaojiale02@163.com \
    --cc=zhang.lyra@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®