public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
From: "Nicolas Escande" <nico.escande@gmail.com>
To: "Baochen Qiang" <baochen.qiang@oss.qualcomm.com>,
	"Nicolas Escande" <nico.escande@gmail.com>,
	<ath12k@lists.infradead.org>
Cc: <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH ath-next v2] wifi: ath12k: avoid dynamic alloc when parsing wmi tb
Date: Mon, 16 Mar 2026 10:35:56 +0100	[thread overview]
Message-ID: <DH43S71XJZBS.1C40IOTKEXO6W@gmail.com> (raw)
In-Reply-To: <55358f82-f0ba-4671-90ed-8061f6ffbabf@oss.qualcomm.com>

On Mon Mar 16, 2026 at 3:27 AM CET, Baochen Qiang wrote:
[...]
> or alternately you can define ath12k_wmi_tb in wmi.c and add alloc/free functions in
> wmi.c, then call them in core.c. this helps modularity IMO?

I'll add new functions to wmi.c and make ath12k_wmi_tb static to that file.
>
> either way works for me!
>
[...]
>> +static int ath12k_init(void)
>> +{
>> +	ath12k_wmi_tb = __alloc_percpu(WMI_TAG_MAX * sizeof(void *),
>> +				       __alignof__(void *));
>> +	if (!ath12k_wmi_tb) {
>> +		pr_warn("Failed to alloc ath12k WMI tb\n");
>
> generally we don't log memory allocation failure

sure will fix

>
>> +		return -ENOMEM;
>> +	}
>> +
>> +	return 0;
>> +}

[...]

>> @@ -9215,11 +9127,8 @@ static void ath12k_wmi_event_teardown_complete(struct ath12k_base *ab,
>>  	ev = tb[WMI_TAG_MLO_TEARDOWN_COMPLETE];
>>  	if (!ev) {
>>  		ath12k_warn(ab, "failed to fetch teardown complete event\n");
>> -		kfree(tb);
>>  		return;
>
> nit: better to remove return as well

Indeed this slipped through the cracks will fix

>
>>  	}
>> -
>> -	kfree(tb);
>>  }
>>  
>>  #ifdef CONFIG_ATH12K_DEBUGFS


      reply	other threads:[~2026-03-16  9:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-13 11:38 [PATCH ath-next v2] wifi: ath12k: avoid dynamic alloc when parsing wmi tb Nicolas Escande
2026-03-16  2:27 ` Baochen Qiang
2026-03-16  9:35   ` Nicolas Escande [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=DH43S71XJZBS.1C40IOTKEXO6W@gmail.com \
    --to=nico.escande@gmail.com \
    --cc=ath12k@lists.infradead.org \
    --cc=baochen.qiang@oss.qualcomm.com \
    --cc=linux-wireless@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