Thread (24 messages) 24 messages, 3 authors, 2023-09-01

Re: [PATCH wpan-next 04/11] mac802154: Handle associating

From: Miquel Raynal <miquel.raynal@bootlin.com>
Date: 2023-08-18 14:18:08

Hi Simon,

simon.horman@corigine.com wrote on Fri, 2 Jun 2023 17:54:40 +0200:
On Thu, Jun 01, 2023 at 05:48:10PM +0200, Miquel Raynal wrote:
quoted
Joining a PAN officially goes by associating with a coordinator. This
coordinator may have been discovered thanks to the beacons it sent in
the past. Add support to the MAC layer for these associations, which
require:
- Sending an association request
- Receiving an association response

The association response contains the association status, eventually a
reason if the association was unsuccessful, and finally a short address
that we should use for intra-PAN communication from now on, if we
required one (which is the default, and not yet configurable).

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>  
...
quoted
diff --git a/net/ieee802154/core.c b/net/ieee802154/core.c
index cd69bdbfd59f..8bf01bb7e858 100644
--- a/net/ieee802154/core.c
+++ b/net/ieee802154/core.c
@@ -198,6 +198,18 @@ void wpan_phy_free(struct wpan_phy *phy)
 }
 EXPORT_SYMBOL(wpan_phy_free);
 
+static void cfg802154_free_peer_structures(struct wpan_dev *wpan_dev)
+{
+	mutex_lock(&wpan_dev->association_lock);
+
+	if (wpan_dev->parent)
+		kfree(wpan_dev->parent);  
Hi Miquel,

a minor nit from my side: There no need to check for NULL before calling
kfree, because kfree will do nothing with a NULL argument.
Sorry for the delay, yes of course, I will drop the extra check.

Thanks,
Miquèl
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help