* dl2k: potential null dereference in recieve_packet()
@ 2009-07-19 11:59 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2009-07-19 11:59 UTC (permalink / raw)
To: netdev
Hello,
Smatch (http://repo.or.cz/w/smatch.git) found a potential null dereference
in drivers/net/dl2k.c receive_packet(). If the allocation on line 874
fails we still dereference skb on line 890.
drivers/net/dl2k.c
874 } else if ((skb = netdev_alloc_skb(dev, pkt_len + 2))) {
875 pci_dma_sync_single_for_cpu(np->pdev,
876 desc_to_dma(desc),
877 np->rx_buf_sz,
878 PCI_DMA_FROMDEVICE);
879 /* 16 byte align the IP header */
880 skb_reserve (skb, 2);
881 skb_copy_to_linear_data (skb,
882 np->rx_skbuff[entry]->data,
883 pkt_len);
884 skb_put (skb, pkt_len);
885 pci_dma_sync_single_for_device(np->pdev,
886 desc_to_dma(desc),
887 np->rx_buf_sz,
888 PCI_DMA_FROMDEVICE);
889 }
890 skb->protocol = eth_type_trans (skb, dev);
regards,
dan carpenter
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-07-19 12:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-19 11:59 dl2k: potential null dereference in recieve_packet() Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox