aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/rx.c
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2007-12-10 00:17:28 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:06:32 -0500
commit7bf02c2985ced746f8b8956dbe4b0384edb41846 (patch)
treee135fe63b95718f3516f5ab8772afa6f2bb48c57 /drivers/net/wireless/libertas/rx.c
parent180be755aec37483337f64bfca3d4b02f5c8fef4 (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.c14
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,
337 // lbs_deb_hex(LBS_DEB_RX, "RX Data: Before chop rxpd", skb->data, min(skb->len, 100)); 337 // lbs_deb_hex(LBS_DEB_RX, "RX Data: Before chop rxpd", skb->data, min(skb->len, 100));
338 338
339 if (skb->len < (ETH_HLEN + 8 + sizeof(struct rxpd))) { 339 if (skb->len < (ETH_HLEN + 8 + sizeof(struct rxpd))) {
340 lbs_deb_rx("rx err: frame received wit bad length\n"); 340 lbs_deb_rx("rx err: frame received with bad length\n");
341 priv->stats.rx_length_errors++; 341 priv->stats.rx_length_errors++;
342 ret = 0; 342 ret = -EINVAL;
343 kfree(skb);
343 goto done; 344 goto done;
344 } 345 }
345 346
@@ -381,10 +382,11 @@ static int process_rxed_802_11_packet(struct lbs_private *priv,
381 382
382 /* add space for the new radio header */ 383 /* add space for the new radio header */
383 if ((skb_headroom(skb) < sizeof(struct rx_radiotap_hdr)) && 384 if ((skb_headroom(skb) < sizeof(struct rx_radiotap_hdr)) &&
384 pskb_expand_head(skb, sizeof(struct rx_radiotap_hdr), 0, 385 pskb_expand_head(skb, sizeof(struct rx_radiotap_hdr), 0, GFP_ATOMIC)) {
385 GFP_ATOMIC)) { 386 lbs_pr_alert("%s: couldn't pskb_expand_head\n", __func__);
386 lbs_pr_alert("%s: couldn't pskb_expand_head\n", 387 ret = -ENOMEM;
387 __func__); 388 kfree_skb(skb);
389 goto done;
388 } 390 }
389 391
390 pradiotap_hdr = (void *)skb_push(skb, sizeof(struct rx_radiotap_hdr)); 392 pradiotap_hdr = (void *)skb_push(skb, sizeof(struct rx_radiotap_hdr));