summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/mwifiex/11n_aggr.c
diff options
context:
space:
mode:
authorChristoph Fritz <chf.fritz@googlemail.com>2011-05-08 22:50:09 +0200
committerJohn W. Linville <linville@tuxdriver.com>2011-05-10 15:54:50 -0400
commitb53575ecf939a4f752de87eabf1adbcfa4478a6c (patch)
tree0e98918a3602d0abd1ff6bcc5dea9cef0763c99d /drivers/net/wireless/mwifiex/11n_aggr.c
parent3ed3f49473985718ce51f84d990ed5b8b6472598 (diff)
mwifiex: fix null derefs, mem leaks and trivia
This patch: - adds kfree() where necessary - prevents potential null dereferences - makes use of kfree_skb() - replaces -1 for failed kzallocs with -ENOMEM Signed-off-by: Christoph Fritz <chf.fritz@googlemail.com> Reviewed-by: Kiran Divekar <dkiran@marvell.com> Tested-by: Amitkumar Karwar <akarwar@marvell.com> Acked-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/mwifiex/11n_aggr.c')
-rw-r--r--drivers/net/wireless/mwifiex/11n_aggr.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/wireless/mwifiex/11n_aggr.c b/drivers/net/wireless/mwifiex/11n_aggr.c
index 12cf4246f96b..2b2cca5e6d0f 100644
--- a/drivers/net/wireless/mwifiex/11n_aggr.c
+++ b/drivers/net/wireless/mwifiex/11n_aggr.c
@@ -318,7 +318,8 @@ mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv,
else
skb_src = NULL;
- pra_list->total_pkts_size -= skb_src->len;
+ if (skb_src)
+ pra_list->total_pkts_size -= skb_src->len;
spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock,
ra_list_flags);
@@ -373,7 +374,8 @@ mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv,
(adapter->pps_uapsd_mode) &&
(adapter->tx_lock_flag)) {
priv->adapter->tx_lock_flag = false;
- ptx_pd->flags = 0;
+ if (ptx_pd)
+ ptx_pd->flags = 0;
}
skb_queue_tail(&pra_list->skb_head, skb_aggr);