linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@kernel.org>
To: Aditya Kumar Singh <quic_adisi@quicinc.com>
Cc: Rameshkumar Sundaram <quic_ramess@quicinc.com>,
	<ath12k@lists.infradead.org>,  <linux-wireless@vger.kernel.org>,
	 Sriram R <quic_srirrama@quicinc.com>
Subject: Re: [PATCH v6 1/3] wifi: ath12k: prepare vif data structure for MLO handling
Date: Tue, 06 Aug 2024 19:32:31 +0300	[thread overview]
Message-ID: <875xsd628w.fsf@kernel.org> (raw)
In-Reply-To: <1510a11a-c31c-4a05-80c0-bffa81fa340a@quicinc.com> (Aditya Kumar Singh's message of "Tue, 6 Aug 2024 21:32:14 +0530")

Aditya Kumar Singh <quic_adisi@quicinc.com> writes:

> On 8/6/24 17:58, Kalle Valo wrote:
>
>> Rameshkumar Sundaram <quic_ramess@quicinc.com> writes:
>> 
>>> From: Sriram R <quic_srirrama@quicinc.com>
>>>
>>> To prepare the driver for MLO support, split the driver vif
>>> data structure to scale for multiple links. This requires changing
>>> the use of arvif to per link and not per hw which can now
>>> comprise of multiple links.
>>> Also since most configurations from mac80211 are done per link, do refactoring
>>> of the driver functions to apply these configurations at link level.
>> Something I noticed while reviewing this patchset:
>> 
>>>   static int ath12k_mac_op_add_interface(struct ieee80211_hw *hw,
>>>   				       struct ieee80211_vif *vif)
>>>   {
>>> -	struct ath12k_vif *arvif = ath12k_vif_to_arvif(vif);
>>> +	struct ath12k_hw *ah = ath12k_hw_to_ah(hw);
>>> +	struct ath12k_vif *ahvif = ath12k_vif_to_ahvif(vif);
>>> +	struct ath12k_link_vif *arvif;
>>>   	int i;
>>>   -	memset(arvif, 0, sizeof(*arvif));
>>> +	mutex_lock(&ah->conf_mutex);
>>> +	memset(ahvif, 0, sizeof(*ahvif));
>> Here we are we clearing ahvif so ahvif->deflink is NULL.
>
> deflink is not a pointer member. It is statically defined inside
> ahvif. So basically this memsets the whole deflink memory region to 0.
>> 
>>> -	arvif->vif = vif;
>>> +	ahvif->ah = ah;
>>> +	ahvif->vif = vif;
>>> +	arvif = &ahvif->deflink;
>> So here we assign arvif to NULL.
>
> This would be a still valid pointer.
>> 
>>> +	arvif->ahvif = ahvif;
>> And because arvif is NULL this is a null pointer reference, right?
>> Or am
>> I missing something?
>
> So since it is valid pointer, this is not a NULL pointer de-reference.

Ah, of course. Clearly my vacation was too good and I forgot C :) Thanks!

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

  reply	other threads:[~2024-08-06 16:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-11 16:55 [PATCH v6 0/3] wifi: ath12k: prepare vif and sta datastructure Rameshkumar Sundaram
2024-07-11 16:55 ` [PATCH v6 1/3] wifi: ath12k: prepare vif data structure for MLO handling Rameshkumar Sundaram
2024-07-16 20:38   ` Jeff Johnson
2024-08-05  9:56   ` Kalle Valo
2024-08-08 10:57     ` Kalle Valo
2024-08-08 16:42       ` Rameshkumar Sundaram
2024-08-09 14:29         ` Kalle Valo
2024-08-09 18:00           ` Rameshkumar Sundaram
2024-08-06 12:28   ` Kalle Valo
2024-08-06 16:02     ` Aditya Kumar Singh
2024-08-06 16:32       ` Kalle Valo [this message]
2024-07-11 16:55 ` [PATCH v6 2/3] wifi: ath12k: pass ath12k_link_vif instead of vif/ahvif Rameshkumar Sundaram
2024-07-11 16:55 ` [PATCH v6 3/3] wifi: ath12k: prepare sta data structure for MLO handling Rameshkumar Sundaram

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=875xsd628w.fsf@kernel.org \
    --to=kvalo@kernel.org \
    --cc=ath12k@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=quic_adisi@quicinc.com \
    --cc=quic_ramess@quicinc.com \
    --cc=quic_srirrama@quicinc.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;
as well as URLs for NNTP newsgroup(s).