From: "Nicolas Escande" <nico.escande@gmail.com>
To: "Pablo MARTIN-GOMEZ" <pmartin-gomez@freebox.fr>,
<ath12k@lists.infradead.org>
Subject: Re: [RFC PATCH 1/1] wifi: ath12k: avoid dynamic alloc when parsing wmi tb
Date: Fri, 27 Feb 2026 10:16:55 +0100 [thread overview]
Message-ID: <DGPMQDTEBLPC.25LCWXNBJJDZX@gmail.com> (raw)
In-Reply-To: <f8b98f6f-5e52-4968-8270-6ffe2e381ae2@freebox.fr>
On Thu Feb 26, 2026 at 8:48 PM CET, Pablo MARTIN-GOMEZ wrote:
[...]
>> @@ -2249,6 +2250,11 @@ struct ath12k_base *ath12k_core_alloc(struct device *dev, size_t priv_size,
>> if (!ab)
>> return NULL;
>>
>> + ab->wmi_tb = __alloc_percpu(WMI_TAG_MAX * sizeof(void *),
>> + __alignof__(void *));
>> + if (!ab->wmi_tb)
>> + goto err_sc_free;
> If `!ab->wmi_tb`, you're going to `free_percpu(ab->wmi_tb)`; it works but it's not super pretty.
Yes it's by design, we do not need to null check before free() and it avoids
adding a new label that would cause more code chrun
>> +
>> init_completion(&ab->driver_recovery);
>>
>> ab->workqueue = create_singlethread_workqueue("ath12k_wq");
>> @@ -2296,6 +2302,7 @@ struct ath12k_base *ath12k_core_alloc(struct device *dev, size_t priv_size,
>> err_free_wq:
>> destroy_workqueue(ab->workqueue);
>> err_sc_free:
>> + free_percpu(ab->wmi_tb);
>> kfree(ab);
>> return NULL;
>> }
> [...]
>> @@ -6795,11 +6749,9 @@ ath12k_pull_pdev_temp_ev(struct ath12k_base *ab, struct sk_buff *skb,
>> ev = tb[WMI_TAG_PDEV_TEMPERATURE_EVENT];
>> if (!ev) {
>> ath12k_warn(ab, "failed to fetch pdev temp ev");
>> - kfree(tb);
>> return -EPROTO;
>> }
>>
>> - kfree(tb);
>> return 0;
>> }
> You're missing a change on `ath12k_reg_11d_new_cc_event` (was added by 591de41d7008585f2e7c35dbcf5922fcb4d79e39)
Indeed, this was ported from an older kernel, I'll fix before non RFC submission
if there is interrest from QCA around this feature.
> [...]
>
> Best regards,
> Pablo MG
next prev parent reply other threads:[~2026-02-27 9:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-26 16:55 [RFC PATCH 0/1] Avoid per WMI message tb allocation Nicolas Escande
2026-02-26 16:55 ` [RFC PATCH 1/1] wifi: ath12k: avoid dynamic alloc when parsing wmi tb Nicolas Escande
2026-02-26 19:48 ` Pablo MARTIN-GOMEZ
2026-02-27 9:16 ` Nicolas Escande [this message]
2026-02-27 3:18 ` Baochen Qiang
2026-02-27 9:22 ` Nicolas Escande
2026-03-03 9:53 ` Rameshkumar Sundaram
2026-03-03 10:23 ` Nicolas Escande
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=DGPMQDTEBLPC.25LCWXNBJJDZX@gmail.com \
--to=nico.escande@gmail.com \
--cc=ath12k@lists.infradead.org \
--cc=pmartin-gomez@freebox.fr \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.