mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 14:53:47 +08:00
ieee802154 MAC: Free allocated TX descriptor if an error occurs after the descriptor has been allocated.
This commit is contained in:
@@ -130,6 +130,7 @@ static void mac802154_resetqueues(FAR struct ieee802154_privmac_s *priv)
|
||||
{
|
||||
sq_addlast((FAR sq_entry_t *)&priv->txdesc_pool[i], &priv->txdesc_queue);
|
||||
}
|
||||
|
||||
sem_init(&priv->txdesc_sem, 0, CONFIG_MAC802154_NTXDESC);
|
||||
|
||||
/* Initialize the notifcation allocation pool */
|
||||
|
||||
@@ -340,7 +340,10 @@ int mac802154_req_data(MACHANDLE mac,
|
||||
return OK;
|
||||
|
||||
errout_with_txdesc:
|
||||
/* REVISIT: Free TX descriptor, but preserve the IOB. */
|
||||
/* Free TX the descriptor, but preserve the IOB. */
|
||||
|
||||
txdesc->frame = NULL;
|
||||
mac802154_txdesc_free(priv, txdesc);
|
||||
|
||||
errout_with_sem:
|
||||
mac802154_givesem(&priv->exclsem);
|
||||
|
||||
Reference in New Issue
Block a user