wireless/bcm43xxx: fix memory leak if tx fail
Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
parent
f424bb32aa
commit
9a4f494da2
@ -387,21 +387,18 @@ int bcmf_sdpcm_sendframe(FAR struct bcmf_dev_s *priv)
|
|||||||
ret = bcmf_transfer_bytes(sbus, true, 2, 0,
|
ret = bcmf_transfer_bytes(sbus, true, 2, 0,
|
||||||
sframe->header.base,
|
sframe->header.base,
|
||||||
sframe->header.len);
|
sframe->header.len);
|
||||||
if (ret == OK)
|
|
||||||
{
|
|
||||||
is_txframe = sframe->tx;
|
is_txframe = sframe->tx;
|
||||||
|
|
||||||
/* Free frame buffer */
|
/* Free frame buffer */
|
||||||
|
|
||||||
bcmf_sdio_free_frame(priv, sframe);
|
bcmf_sdio_free_frame(priv, sframe);
|
||||||
|
|
||||||
if (is_txframe)
|
if (ret == OK && is_txframe)
|
||||||
{
|
{
|
||||||
/* Notify upper layer at least one TX buffer is available */
|
/* Notify upper layer at least one TX buffer is available */
|
||||||
|
|
||||||
bcmf_netdev_notify_tx(priv);
|
bcmf_netdev_notify_tx(priv);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user