mirror of
https://github.com/apache/nuttx.git
synced 2026-06-01 16:59:28 +08:00
ieee802154 MAC: Free allocated TX descriptor if an error occurs after the descriptor has been allocated.
This commit is contained in:
@@ -550,7 +550,7 @@ int sixlowpan_queue_frames(FAR struct ieee802154_driver_s *ieee,
|
|||||||
|
|
||||||
/* And submit the frame to the MAC */
|
/* And submit the frame to the MAC */
|
||||||
|
|
||||||
ninfo("Submitting framelist\n");
|
ninfo("Submitting frame\n");
|
||||||
ret = sixlowpan_frame_submit(ieee, &meta, iob);
|
ret = sixlowpan_frame_submit(ieee, &meta, iob);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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);
|
sq_addlast((FAR sq_entry_t *)&priv->txdesc_pool[i], &priv->txdesc_queue);
|
||||||
}
|
}
|
||||||
|
|
||||||
sem_init(&priv->txdesc_sem, 0, CONFIG_MAC802154_NTXDESC);
|
sem_init(&priv->txdesc_sem, 0, CONFIG_MAC802154_NTXDESC);
|
||||||
|
|
||||||
/* Initialize the notifcation allocation pool */
|
/* Initialize the notifcation allocation pool */
|
||||||
|
|||||||
@@ -340,7 +340,10 @@ int mac802154_req_data(MACHANDLE mac,
|
|||||||
return OK;
|
return OK;
|
||||||
|
|
||||||
errout_with_txdesc:
|
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:
|
errout_with_sem:
|
||||||
mac802154_givesem(&priv->exclsem);
|
mac802154_givesem(&priv->exclsem);
|
||||||
|
|||||||
Reference in New Issue
Block a user