Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by

Dan Williams and committed by
John W. Linville
d2ed2703 2ad69ac5

+5 -3
+5 -3
drivers/net/wireless/libertas/rx.c
··· 71 71 72 72 skb->ip_summed = CHECKSUM_NONE; 73 73 74 - if (priv->wdev->iftype == NL80211_IFTYPE_MONITOR) 75 - return process_rxed_802_11_packet(priv, skb); 74 + if (priv->wdev->iftype == NL80211_IFTYPE_MONITOR) { 75 + ret = process_rxed_802_11_packet(priv, skb); 76 + goto done; 77 + } 76 78 77 79 p_rx_pd = (struct rxpd *) skb->data; 78 80 p_rx_pkt = (struct rxpackethdr *) ((u8 *)p_rx_pd + ··· 88 86 if (skb->len < (ETH_HLEN + 8 + sizeof(struct rxpd))) { 89 87 lbs_deb_rx("rx err: frame received with bad length\n"); 90 88 dev->stats.rx_length_errors++; 91 - ret = 0; 89 + ret = -EINVAL; 92 90 dev_kfree_skb(skb); 93 91 goto done; 94 92 }