diff options
author | Claudiu Beznea <claudiu.beznea@gmail.com> | 2016-04-25 02:07:18 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-04-28 22:06:51 -0700 |
commit | 245b431b76ada80aa2a3ea36e46ab5a45b84e0ee (patch) | |
tree | 91b4799af043d5e255da72302c47f3ce29833deb /drivers/staging/wilc1000 | |
parent | 8958f5811ca5f602cfb2987f7977744a458421af (diff) |
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>
Diffstat (limited to 'drivers/staging/wilc1000')
-rw-r--r-- | drivers/staging/wilc1000/wilc_wlan.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 7da3b4ac1dc5..11e16d56ace7 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -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; } |