Skip to contentSkip to conversation

orinoco: possible null pointer dereference in orinoco_rx_monitor()

PATCH New Florin Malita 1 participant 1 message May 20, 2006 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---

drivers/net/wireless/orinoco.c +1 -3
index 06523e2..c2d0b09 100644
@@ -812,7 +812,6 @@ static void orinoco_rx_monitor(struct ne
 	if (datalen > IEEE80211_DATA_LEN + 12) {
 		printk(KERN_DEBUG "%s: oversized monitor frame, "
 		       "data length = %d\n", dev->name, datalen);
-		err = -EIO;
 		stats->rx_length_errors++;
 		goto update_stats;
 	}
@@ -821,8 +820,7 @@ static void orinoco_rx_monitor(struct ne
 	if (!skb) {
 		printk(KERN_WARNING "%s: Cannot allocate skb for monitor frame\n",
 		       dev->name);
-		err = -ENOMEM;
-		goto drop;
+		goto update_stats;
 	}
 
 	/* Copy the 802.11 header to the skb */