Showing error 1824

User: Jiri Slaby
Error type: Invalid Pointer Dereference
Error type description: A pointer which is invalid is being dereferenced
File location: drivers/net/dl2k.c
Line in file: 886
Project: Linux Kernel
Project version: 2.6.28
Tools: Smatch (1.59)
Entered: 2013-09-11 08:47:26 UTC


Source:

 856                                np->stats.rx_frame_errors++;
 857                        if (frame_status & RxFIFOOverrun)
 858                                 np->stats.rx_fifo_errors++;
 859                } else {
 860                        struct sk_buff *skb;
 861
 862                        /* Small skbuffs for short packets */
 863                        if (pkt_len > copy_thresh) {
 864                                pci_unmap_single (np->pdev,
 865                                                  desc_to_dma(desc),
 866                                                  np->rx_buf_sz,
 867                                                  PCI_DMA_FROMDEVICE);
 868                                skb_put (skb = np->rx_skbuff[entry], pkt_len);
 869                                np->rx_skbuff[entry] = NULL;
 870                        } else if ((skb = netdev_alloc_skb(dev, pkt_len + 2))) {
 871                                pci_dma_sync_single_for_cpu(np->pdev,
 872                                                            desc_to_dma(desc),
 873                                                            np->rx_buf_sz,
 874                                                            PCI_DMA_FROMDEVICE);
 875                                /* 16 byte align the IP header */
 876                                skb_reserve (skb, 2);
 877                                skb_copy_to_linear_data (skb,
 878                                                  np->rx_skbuff[entry]->data,
 879                                                  pkt_len);
 880                                skb_put (skb, pkt_len);
 881                                pci_dma_sync_single_for_device(np->pdev,
 882                                                               desc_to_dma(desc),
 883                                                               np->rx_buf_sz,
 884                                                               PCI_DMA_FROMDEVICE);
 885                        }
 886                        skb->protocol = eth_type_trans (skb, dev);
 887#if 0
 888                        /* Checksum done by hw, but csum value unavailable. */
 889                        if (np->pdev->pci_rev_id >= 0x0c &&
 890                                !(frame_status & (TCPError | UDPError | IPError))) {
 891                                skb->ip_summed = CHECKSUM_UNNECESSARY;
 892                        }
 893#endif
 894                        netif_rx (skb);
 895                        dev->last_rx = jiffies;
 896                }
Show full sources