1
0
Fork 0

Staging: wilc1000: Freed memory in case of error

This patch frees memory allocated inside wilc_wlan_txq_add_cfg_pkt()
in case wilc_wlan_txq_add_to_head() fails.

Signed-off-by: Claudiu Beznea <claudiu.beznea@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
hifive-unleashed-5.1
Claudiu Beznea 2016-04-25 02:07:18 +03:00 committed by Greg Kroah-Hartman
parent 8958f5811c
commit 245b431b76
1 changed files with 4 additions and 1 deletions

View File

@ -325,8 +325,11 @@ static int wilc_wlan_txq_add_cfg_pkt(struct wilc_vif *vif, u8 *buffer,
tqe->priv = NULL;
tqe->tcp_pending_ack_idx = NOT_TCP_ACK;
if (wilc_wlan_txq_add_to_head(vif, tqe))
if (wilc_wlan_txq_add_to_head(vif, tqe)) {
kfree(tqe);
return 0;
}
return 1;
}