[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b69308a5-0d29-6b48-833c-f3eacfe03b08@quicinc.com>
Date: Tue, 8 Mar 2022 16:05:09 -0800
From: Jeff Johnson <quic_jjohnson@...cinc.com>
To: Miaoqian Lin <linmq006@...il.com>, Kalle Valo <kvalo@...nel.org>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
"Rakesh Pillai" <pillair@...eaurora.org>,
<ath10k@...ts.infradead.org>, <linux-wireless@...r.kernel.org>,
<netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] ath10k: Fix error handling in ath10k_setup_msa_resources
On 3/7/2022 11:02 PM, Miaoqian Lin wrote:
> The device_node pointer is returned by of_parse_phandle() with refcount
Kalle, can you fix this nit when you apply? remove extra space after ()
> incremented. We should use of_node_put() on it when done.
>
> This function only calls of_node_put() in the regular path.
> And it will cause refcount leak in error path.
>
> Fixes: 727fec790ead ("ath10k: Setup the msa resources before qmi init")
> Signed-off-by: Miaoqian Lin <linmq006@...il.com>
> ---
> drivers/net/wireless/ath/ath10k/snoc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/ath/ath10k/snoc.c b/drivers/net/wireless/ath/ath10k/snoc.c
> index 9513ab696fff..f79dd9a71690 100644
> --- a/drivers/net/wireless/ath/ath10k/snoc.c
> +++ b/drivers/net/wireless/ath/ath10k/snoc.c
> @@ -1556,11 +1556,11 @@ static int ath10k_setup_msa_resources(struct ath10k *ar, u32 msa_size)
> node = of_parse_phandle(dev->of_node, "memory-region", 0);
> if (node) {
> ret = of_address_to_resource(node, 0, &r);
> + of_node_put(node);
> if (ret) {
> dev_err(dev, "failed to resolve msa fixed region\n");
> return ret;
> }
> - of_node_put(node);
>
> ar->msa.paddr = r.start;
> ar->msa.mem_size = resource_size(&r);
Reviewed-by: Jeff Johnson <quic_jjohnson@...cinc.com>
Powered by blists - more mailing lists