Skip to content

Commit 82464e6

Browse files
fmalitalinvjw
authored andcommitted
[PATCH] orinoco: possible null pointer dereference in orinoco_rx_monitor()
If the skb allocation fails, the current error path calls dev_kfree_skb_irq() with a NULL argument. Also, 'err' is not being used. Coverity CID: 275. Signed-off-by: Florin Malita <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: John W. Linville <[email protected]>
1 parent 353b28b commit 82464e6

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/net/wireless/orinoco.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,6 @@ static void orinoco_rx_monitor(struct net_device *dev, u16 rxfid,
812812
if (datalen > IEEE80211_DATA_LEN + 12) {
813813
printk(KERN_DEBUG "%s: oversized monitor frame, "
814814
"data length = %d\n", dev->name, datalen);
815-
err = -EIO;
816815
stats->rx_length_errors++;
817816
goto update_stats;
818817
}
@@ -821,8 +820,7 @@ static void orinoco_rx_monitor(struct net_device *dev, u16 rxfid,
821820
if (!skb) {
822821
printk(KERN_WARNING "%s: Cannot allocate skb for monitor frame\n",
823822
dev->name);
824-
err = -ENOMEM;
825-
goto drop;
823+
goto update_stats;
826824
}
827825

828826
/* Copy the 802.11 header to the skb */

0 commit comments

Comments
 (0)