Commit d2ed2703 authored by Dan Williams's avatar Dan Williams Committed by John W. Linville

libertas: fix return value when processing invalid packet

Nothing actually uses the return value yet, but we might as well
make it correct, like process_rxed_802_11_packet() does for the
same case.  Also ensure that if monitor mode is enabled (and
thus process_rxed_802_11_packet() is called) that the debugging
enter/leave functions are balanced.
Signed-off-by: default avatarDan Williams <dcbw@redhat.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 2ad69ac5
...@@ -71,8 +71,10 @@ int lbs_process_rxed_packet(struct lbs_private *priv, struct sk_buff *skb) ...@@ -71,8 +71,10 @@ int lbs_process_rxed_packet(struct lbs_private *priv, struct sk_buff *skb)
skb->ip_summed = CHECKSUM_NONE; skb->ip_summed = CHECKSUM_NONE;
if (priv->wdev->iftype == NL80211_IFTYPE_MONITOR) if (priv->wdev->iftype == NL80211_IFTYPE_MONITOR) {
return process_rxed_802_11_packet(priv, skb); ret = process_rxed_802_11_packet(priv, skb);
goto done;
}
p_rx_pd = (struct rxpd *) skb->data; p_rx_pd = (struct rxpd *) skb->data;
p_rx_pkt = (struct rxpackethdr *) ((u8 *)p_rx_pd + p_rx_pkt = (struct rxpackethdr *) ((u8 *)p_rx_pd +
...@@ -86,7 +88,7 @@ int lbs_process_rxed_packet(struct lbs_private *priv, struct sk_buff *skb) ...@@ -86,7 +88,7 @@ int lbs_process_rxed_packet(struct lbs_private *priv, struct sk_buff *skb)
if (skb->len < (ETH_HLEN + 8 + sizeof(struct rxpd))) { if (skb->len < (ETH_HLEN + 8 + sizeof(struct rxpd))) {
lbs_deb_rx("rx err: frame received with bad length\n"); lbs_deb_rx("rx err: frame received with bad length\n");
dev->stats.rx_length_errors++; dev->stats.rx_length_errors++;
ret = 0; ret = -EINVAL;
dev_kfree_skb(skb); dev_kfree_skb(skb);
goto done; goto done;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment