[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 <fmalita@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Florin Malita 2006-05-21 14:04:44 -07:00 committed by John W. Linville
parent 353b28bafd
commit 82464e63a0
1 changed files with 1 additions and 3 deletions

View File

@ -812,7 +812,6 @@ static void orinoco_rx_monitor(struct net_device *dev, u16 rxfid,
if (datalen > IEEE80211_DATA_LEN + 12) { if (datalen > IEEE80211_DATA_LEN + 12) {
printk(KERN_DEBUG "%s: oversized monitor frame, " printk(KERN_DEBUG "%s: oversized monitor frame, "
"data length = %d\n", dev->name, datalen); "data length = %d\n", dev->name, datalen);
err = -EIO;
stats->rx_length_errors++; stats->rx_length_errors++;
goto update_stats; goto update_stats;
} }
@ -821,8 +820,7 @@ static void orinoco_rx_monitor(struct net_device *dev, u16 rxfid,
if (!skb) { if (!skb) {
printk(KERN_WARNING "%s: Cannot allocate skb for monitor frame\n", printk(KERN_WARNING "%s: Cannot allocate skb for monitor frame\n",
dev->name); dev->name);
err = -ENOMEM; goto update_stats;
goto drop;
} }
/* Copy the 802.11 header to the skb */ /* Copy the 802.11 header to the skb */