diff options
author | David Woodhouse <dwmw2@infradead.org> | 2007-12-10 00:17:28 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 15:06:32 -0800 |
commit | 7bf02c2985ced746f8b8956dbe4b0384edb41846 (patch) | |
tree | e135fe63b95718f3516f5ab8772afa6f2bb48c57 /drivers/net/wireless/libertas/rx.c | |
parent | 180be755aec37483337f64bfca3d4b02f5c8fef4 (diff) |
libertas: fix error cases in lbs_process_rxed_802_11_packet()
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/rx.c')
-rw-r--r-- | drivers/net/wireless/libertas/rx.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/net/wireless/libertas/rx.c b/drivers/net/wireless/libertas/rx.c index 90a21996e82..141069fa67f 100644 --- a/drivers/net/wireless/libertas/rx.c +++ b/drivers/net/wireless/libertas/rx.c @@ -337,9 +337,10 @@ static int process_rxed_802_11_packet(struct lbs_private *priv, // lbs_deb_hex(LBS_DEB_RX, "RX Data: Before chop rxpd", skb->data, min(skb->len, 100)); if (skb->len < (ETH_HLEN + 8 + sizeof(struct rxpd))) { - lbs_deb_rx("rx err: frame received wit bad length\n"); + lbs_deb_rx("rx err: frame received with bad length\n"); priv->stats.rx_length_errors++; - ret = 0; + ret = -EINVAL; + kfree(skb); goto done; } @@ -381,10 +382,11 @@ static int process_rxed_802_11_packet(struct lbs_private *priv, /* add space for the new radio header */ if ((skb_headroom(skb) < sizeof(struct rx_radiotap_hdr)) && - pskb_expand_head(skb, sizeof(struct rx_radiotap_hdr), 0, - GFP_ATOMIC)) { - lbs_pr_alert("%s: couldn't pskb_expand_head\n", - __func__); + pskb_expand_head(skb, sizeof(struct rx_radiotap_hdr), 0, GFP_ATOMIC)) { + lbs_pr_alert("%s: couldn't pskb_expand_head\n", __func__); + ret = -ENOMEM; + kfree_skb(skb); + goto done; } pradiotap_hdr = (void *)skb_push(skb, sizeof(struct rx_radiotap_hdr)); |