1. Summary
  2. Files
  3. Support
  4. Report Spam
  5. Create account
  6. Log in

ScanLinuxKernel/20120218-nullpointer

From cppcheck

Jump to: navigation, search

Contents

Scan report

Project: Linux Kernel 3.0.1

Date: 2012-02-18

Cppcheck: latest git head

Commands used:

 cppcheck -j2 --xml-version=2 drivers 2> cppcheck-results-120218.xml
 xsltproc nullpointer.xsl cppcheck-results-120218.xml


nullpointer.xsl

 <?xml version="1.0"?>
 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 <xsl:output method="text"/>
 <xsl:template match="/">
   <xsl:for-each select="results/errors/error[@id='nullPointer']">[<xsl:value-of select="location/@file"/>:<xsl:value-of select="location/@line"/>] <xsl:value-of select="@msg"/><xsl:text>
 </xsl:text></xsl:for-each>
 </xsl:template>
 </xsl:stylesheet> 


False positives

 [drivers/clk/clkdev.c:74] Possible null pointer dereference: cl - otherwise it is redundant to check if cl is null at line 70
 [drivers/infiniband/hw/mthca/mthca_av.c:199] Possible null pointer dereference: av
 [drivers/isdn/hardware/eicon/message.c:12388] Possible null pointer dereference: plci - otherwise it is redundant to check if plci is null at line 12393
 [drivers/rapidio/rio-scan.c:521] Possible null pointer dereference: rswitch
 [drivers/regulator/wm831x-dcdc.c:507] Possible null pointer dereference: pdata - otherwise it is redundant to check if pdata is null at line 514
 [drivers/regulator/wm831x-dcdc.c:712] Possible null pointer dereference: pdata - otherwise it is redundant to check if pdata is null at line 719
 [drivers/regulator/wm831x-dcdc.c:840] Possible null pointer dereference: pdata - otherwise it is redundant to check if pdata is null at line 847
 [drivers/regulator/wm831x-dcdc.c:945] Possible null pointer dereference: pdata - otherwise it is redundant to check if pdata is null at line 951
 [drivers/regulator/wm831x-isink.c:156] Possible null pointer dereference: pdata - otherwise it is redundant to check if pdata is null at line 162
 [drivers/regulator/wm831x-ldo.c:313] Possible null pointer dereference: pdata - otherwise it is redundant to check if pdata is null at line 320
 [drivers/regulator/wm831x-ldo.c:577] Possible null pointer dereference: pdata - otherwise it is redundant to check if pdata is null at line 584
 [drivers/regulator/wm831x-ldo.c:767] Possible null pointer dereference: pdata - otherwise it is redundant to check if pdata is null at line 774
 [drivers/regulator/wm8994-regulator.c:222] Possible null pointer dereference: pdata - otherwise it is redundant to check if pdata is null at line 228
 
 [drivers/scsi/isci/firmware/create_fw.c:25] Possible null pointer dereference: fd - otherwise it is redundant to check if fd is null at line 23
   => calling fclose is redundant
 
 [drivers/scsi/lpfc/lpfc_els.c:3219] Possible null pointer dereference: buf_ptr

True positives

 [drivers/char/pcmcia/synclink_cs.c:1055] Possible null pointer dereference: tty - otherwise it is redundant to check if tty is null at line 1059
 [drivers/infiniband/hw/ehca/ehca_mrmw.c:320] Possible null pointer dereference: pd - otherwise it is redundant to check if pd is null at line 328
 [drivers/isdn/hisax/l3dss1.c:2211] Possible null pointer dereference: pc - otherwise it is redundant to check if pc is null at line 2216
 [drivers/isdn/hisax/l3dss1.c:2212] Possible null pointer dereference: pc - otherwise it is redundant to check if pc is null at line 2216
 [drivers/isdn/hisax/l3dss1.c:2211] Possible null pointer dereference: pc
 [drivers/isdn/hisax/l3dss1.c:2212] Possible null pointer dereference: pc
 [drivers/isdn/hisax/l3ni1.c:2067] Possible null pointer dereference: pc - otherwise it is redundant to check if pc is null at line 2072
 [drivers/isdn/hisax/l3ni1.c:2068] Possible null pointer dereference: pc - otherwise it is redundant to check if pc is null at line 2072
 [drivers/isdn/hisax/l3ni1.c:2067] Possible null pointer dereference: pc
 [drivers/isdn/hisax/l3ni1.c:2068] Possible null pointer dereference: pc
 [drivers/isdn/icn/icn.c:1584] Possible null pointer dereference: card2 - otherwise it is redundant to check if card2 is null at line 1581
 [drivers/macintosh/windfarm_pm121.c:574] Possible null pointer dereference: control - otherwise it is redundant to check if control is null at line 576
 [drivers/macintosh/windfarm_pm121.c:574] Possible null pointer dereference: control
 [drivers/media/dvb/frontends/stv0900_core.c:533] Possible null pointer dereference: tuner_ops
 [drivers/media/dvb/frontends/stv0900_core.c:561] Possible null pointer dereference: tuner_ops
 [drivers/media/dvb/frontends/stv0900_sw.c:1178] Possible null pointer dereference: tuner_ops
 [drivers/media/video/cx231xx/cx231xx-audio.c:431] Possible null pointer dereference: dev - otherwise it is redundant to check if dev is null at line 429
 [drivers/media/video/s5p-fimc/fimc-core.c:305] Possible null pointer dereference: ctx - otherwise it is redundant to check if ctx is null at line 307
 [drivers/message/fusion/mptscsih.c:1281] Possible null pointer dereference: h - otherwise it is redundant to check if h is null at line 1271
 [drivers/message/fusion/mptscsih.c:1469] Possible null pointer dereference: vdevice - otherwise it is redundant to check if vdevice is null at line 1454
 [drivers/message/fusion/mptscsih.c:1470] Possible null pointer dereference: vdevice - otherwise it is redundant to check if vdevice is null at line 1454
 [drivers/mfd/t7l66xb.c:386] Possible null pointer dereference: pdata - otherwise it is redundant to check if pdata is null at line 374
 [drivers/mmc/host/davinci_mmc.c:1263] Possible null pointer dereference: pdata - otherwise it is redundant to check if pdata is null at line 1280
 [drivers/mmc/host/davinci_mmc.c:1286] Possible null pointer dereference: pdata - otherwise it is redundant to check if pdata is null at line 1291
 [drivers/mmc/host/davinci_mmc.c:1286] Possible null pointer dereference: pdata - otherwise it is redundant to check if pdata is null at line 1283
 [drivers/mmc/host/sh_mobile_sdhi.c:74] Possible null pointer dereference: p - otherwise it is redundant to check if p is null at line 90
 [drivers/net/bna/bnad.c:544] Possible null pointer dereference: ccb - otherwise it is redundant to check if ccb is null at line 546
 [drivers/net/davinci_cpdma.c:534] Possible null pointer dereference: chan - otherwise it is redundant to check if chan is null at line 537
 [drivers/net/ehea/ehea_qmr.c:109] Possible null pointer dereference: queue - otherwise it is redundant to check if queue is null at line 112
 [drivers/net/hamradio/yam.c:869] Possible null pointer dereference: dev - otherwise it is redundant to check if dev is null at line 871
 [drivers/net/ps3_gelic_net.c:1570] Possible null pointer dereference: netdev - otherwise it is redundant to check if netdev is null at line 1571
 [drivers/net/wireless/ath/ath9k/hif_usb.c:130] Possible null pointer dereference: cmd - otherwise it is redundant to check if cmd is null at line 133
 [drivers/net/wireless/mwifiex/cmdevt.c:817] Possible null pointer dereference: cmd_node - otherwise it is redundant to check if cmd_node is null at line 820
 [drivers/net/wireless/mwifiex/main.c:776] Possible null pointer dereference: dev - otherwise it is redundant to check if dev is null at line 783
 [drivers/net/wireless/mwifiex/main.c:778] Possible null pointer dereference: dev - otherwise it is redundant to check if dev is null at line 783
 [drivers/net/wireless/mwifiex/sdio.c:97] Possible null pointer dereference: func - otherwise it is redundant to check if func is null at line 99
 [drivers/net/wireless/mwifiex/sta_ioctl.c:845] Possible null pointer dereference: rate - otherwise it is redundant to check if rate is null at line 849
 [drivers/net/wireless/mwifiex/sta_rx.c:171] Possible null pointer dereference: priv - otherwise it is redundant to check if priv is null at line 193
 [drivers/pci/hotplug/cpqphp_ctrl.c:712] Possible null pointer dereference: temp - otherwise it is redundant to check if temp is null at line 708
 [drivers/power/s3c_adc_battery.c:130] Possible null pointer dereference: bat - otherwise it is redundant to check if bat is null at line 133
 [drivers/power/s3c_adc_battery.c:131] Possible null pointer dereference: bat - otherwise it is redundant to check if bat is null at line 133
 [drivers/s390/net/netiucv.c:738] Possible null pointer dereference: conn - otherwise it is redundant to check if conn is null at line 736
 [drivers/s390/net/qeth_core_main.c:758] Possible null pointer dereference: card - otherwise it is redundant to check if card is null at line 761
 [drivers/s390/net/qeth_core_main.c:759] Possible null pointer dereference: card - otherwise it is redundant to check if card is null at line 761
 [drivers/s390/net/qeth_l3_main.c:3614] Possible null pointer dereference: card - otherwise it is redundant to check if card is null at line 3615
 [drivers/scsi/bfa/bfa_fcs_lport.c:4746] Possible null pointer dereference: port - otherwise it is redundant to check if port is null at line 4749
 [drivers/scsi/bnx2fc/bnx2fc_io.c:675] Possible null pointer dereference: rport - otherwise it is redundant to check if rport is null at line 696
 [drivers/scsi/bnx2i/bnx2i_iscsi.c:245] Possible null pointer dereference: hba - otherwise it is redundant to check if hba is null at line 239
 [drivers/scsi/dc395x.c:2638] Possible null pointer dereference: srb
 [drivers/scsi/libsas/sas_scsi_host.c:457] Possible null pointer dereference: exphy
 [drivers/scsi/mvsas/mv_sas.c:1497] Possible null pointer dereference: mvi_dev - otherwise it is redundant to check if mvi_dev is null at line 1501
 [drivers/scsi/mvsas/mv_sas.c:1768] Possible null pointer dereference: mvi_dev - otherwise it is redundant to check if mvi_dev is null at line 1763
 [drivers/scsi/pm8001/pm8001_hwi.c:4401] Possible null pointer dereference: buffer
 [drivers/staging/brcm80211/brcmfmac/dhd_linux.c:459] Possible null pointer dereference: dhd - otherwise it is redundant to check if dhd is null at line 461
 [drivers/staging/brcm80211/brcmsmac/hnddma.c:978] Possible null pointer dereference: di - otherwise it is redundant to check if di is null at line 980
 [drivers/staging/brcm80211/brcmsmac/wl_mac80211.c:1164] Possible null pointer dereference: wl - otherwise it is redundant to check if wl is null at line 1163
 [drivers/staging/brcm80211/brcmsmac/wl_mac80211.c:1189] Possible null pointer dereference: wl - otherwise it is redundant to check if wl is null at line 1188
 [drivers/staging/cx25821/cx25821-video.c:1101] Possible null pointer dereference: fh - otherwise it is redundant to check if fh is null at line 1094
 [drivers/staging/tidspbridge/pmgr/cmm.c:856] Possible null pointer dereference: xlator_obj - otherwise it is redundant to check if xlator_obj is null at line 861
 [drivers/staging/tidspbridge/pmgr/cmm.c:859] Possible null pointer dereference: xlator_obj - otherwise it is redundant to check if xlator_obj is null at line 861
 [drivers/staging/tidspbridge/pmgr/cmm.c:892] Possible null pointer dereference: xlator_obj - otherwise it is redundant to check if xlator_obj is null at line 894
 
 [drivers/staging/tidspbridge/pmgr/cod.c:387] Possible null pointer dereference: lib - otherwise it is redundant to check if lib is null at line 394
   => think it's a true positive (redundant condition at line 394)
 [drivers/staging/tidspbridge/pmgr/cod.c:617] Possible null pointer dereference: lib - otherwise it is redundant to check if lib is null at line 621
   => think it's a true positive (redundant condition at line 621)
 
 [drivers/staging/tidspbridge/rmgr/node.c:2463] Possible null pointer dereference: hnode - otherwise it is redundant to check if hnode is null at line 2466
 [drivers/staging/tm6000/tm6000-alsa.c:478] Possible null pointer dereference: dev - otherwise it is redundant to check if dev is null at line 480
 [drivers/staging/tm6000/tm6000-video.c:180] Possible null pointer dereference: buf - otherwise it is redundant to check if buf is null at line 183
 [drivers/staging/westbridge/astoria/block/cyasblkdev_block.c:232] Possible null pointer dereference: bd - otherwise it is redundant to check if bd is null at line 222
 [drivers/staging/xgifb/vb_setmode.c:3354] Possible null pointer dereference: CHTVVCLKPtr
 [drivers/staging/zram/zram_sysfs.c:95] Possible null pointer dereference: bdev - otherwise it is redundant to check if bdev is null at line 106
 [drivers/target/target_core_device.c:69] Possible null pointer dereference: se_cmd - otherwise it is redundant to check if se_cmd is null at line 72
 [drivers/target/target_core_device.c:90] Possible null pointer dereference: se_cmd - otherwise it is redundant to check if se_cmd is null at line 72
 [drivers/target/target_core_device.c:91] Possible null pointer dereference: se_cmd - otherwise it is redundant to check if se_cmd is null at line 72
 [drivers/target/target_core_device.c:92] Possible null pointer dereference: se_cmd - otherwise it is redundant to check if se_cmd is null at line 72
 [drivers/target/target_core_device.c:93] Possible null pointer dereference: se_cmd - otherwise it is redundant to check if se_cmd is null at line 72
 [drivers/staging/easycap/easycap_main.c:736] Possible null pointer dereference: peasycap - otherwise it is redundant to check if peasycap is null at line 735
 [drivers/staging/easycap/easycap_main.c:3420] Possible null pointer dereference: peasycap - otherwise it is redundant to check if peasycap is null at line 3418
 [drivers/staging/easycap/easycap_main.c:3498] Possible null pointer dereference: peasycap - otherwise it is redundant to check if peasycap is null at line 3497
 [drivers/staging/easycap/easycap_main.c:3828] Possible null pointer dereference: peasycap - otherwise it is redundant to check if peasycap is null at line 3827
 [drivers/staging/easycap/easycap_main.c:3844] Possible null pointer dereference: peasycap - otherwise it is redundant to check if peasycap is null at line 3843
 [drivers/staging/ft1000/ft1000-pcmcia/ft1000_cs.c:149] Possible null pointer dereference: link - otherwise it is redundant to check if link is null at line 153
 [drivers/staging/line6/toneport.c:440] Possible null pointer dereference: toneport - otherwise it is redundant to check if toneport is null at line 445
 [drivers/tty/serial/68328serial.c:1026] Possible null pointer dereference: info - otherwise it is redundant to check if info is null at line 1029
 [drivers/tty/serial/68360serial.c:997] Possible null pointer dereference: tty - otherwise it is redundant to check if tty is null at line 1000
 [drivers/tty/serial/68360serial.c:1036] Possible null pointer dereference: tty - otherwise it is redundant to check if tty is null at line 1039
 [drivers/tty/serial/altera_uart.c:558] Possible null pointer dereference: platp - otherwise it is redundant to check if platp is null at line 570
 [drivers/tty/serial/altera_uart.c:566] Possible null pointer dereference: platp - otherwise it is redundant to check if platp is null at line 570
 [drivers/tty/serial/crisv10.c:3148] Possible null pointer dereference: tty - otherwise it is redundant to check if tty is null at line 3153
 [drivers/tty/serial/imx.c:1327] Possible null pointer dereference: sport - otherwise it is redundant to check if sport is null at line 1322
 
 [drivers/tty/sysrq.c:134] Possible null pointer dereference: killer
   => seems to be intentional
 
 [drivers/usb/host/ehci-tegra.c:739] Possible null pointer dereference: tegra - otherwise it is redundant to check if tegra is null at line 741
 [drivers/usb/host/isp116x-hcd.c:510] Possible null pointer dereference: last_ep
 [drivers/usb/core/hub.c:1637] Possible null pointer dereference: udev - otherwise it is redundant to check if udev is null at line 1639
 [drivers/usb/musb/musb_gadget.c:1883] Possible null pointer dereference: musb - otherwise it is redundant to check if musb is null at line 1882
 [drivers/usb/serial/keyspan.c:1839] Possible null pointer dereference: this_urb - otherwise it is redundant to check if this_urb is null at line 1842
 [drivers/video/epson1355fb.c:584] Possible null pointer dereference: info - otherwise it is redundant to check if info is null at line 593
 [drivers/video/s3fb.c:1372] Possible null pointer dereference: info - otherwise it is redundant to check if info is null at line 1374
 [drivers/video/sh_mobile_hdmi.c:859] Possible null pointer dereference: info - otherwise it is redundant to check if info is null at line 861
 [drivers/video/skeletonfb.c:698] Possible null pointer dereference: info - otherwise it is redundant to check if info is null at line 694
 [drivers/video/skeletonfb.c:706] Possible null pointer dereference: info - otherwise it is redundant to check if info is null at line 694
 [drivers/video/skeletonfb.c:707] Possible null pointer dereference: info - otherwise it is redundant to check if info is null at line 694
 [drivers/video/skeletonfb.c:708] Possible null pointer dereference: info - otherwise it is redundant to check if info is null at line 694
 [drivers/video/skeletonfb.c:711] Possible null pointer dereference: info - otherwise it is redundant to check if info is null at line 694
 [drivers/video/skeletonfb.c:733] Possible null pointer dereference: info - otherwise it is redundant to check if info is null at line 694
 [drivers/video/skeletonfb.c:749] Possible null pointer dereference: info - otherwise it is redundant to check if info is null at line 694
 [drivers/xen/xenbus/xenbus_probe_backend.c:106] Possible null pointer dereference: xdev - otherwise it is redundant to check if xdev is null at line 107

Unsure

 [drivers/net/bna/bna_txrx.c:146] Possible null pointer dereference: qset
 [drivers/net/bna/bna_txrx.c:416] Possible null pointer dereference: ib_mem
 [drivers/net/bna/bna_txrx.c:419] Possible null pointer dereference: ib_mem
 [drivers/net/bna/bna_txrx.c:422] Possible null pointer dereference: ib_mem
 [drivers/net/bna/bna_txrx.c:425] Possible null pointer dereference: ib_mem
 [drivers/net/bna/bna_txrx.c:428] Possible null pointer dereference: ib_mem
 [drivers/net/bna/bna_txrx.c:981] Possible null pointer dereference: rss_mem
 [drivers/net/bna/bna_txrx.c:986] Possible null pointer dereference: rss_mem
 [drivers/net/bna/bna_txrx.c:1008] Possible null pointer dereference: rx_fndb_ram
 [drivers/net/bna/bna_txrx.c:1013] Possible null pointer dereference: rx_fndb_ram
 [drivers/net/bna/bna_txrx.c:1018] Possible null pointer dereference: rx_fndb_ram
 [drivers/net/bna/bna_txrx.c:1029] Possible null pointer dereference: rx_fndb_ram
 [drivers/net/bna/bna_txrx.c:2125] Possible null pointer dereference: q_mem
 [drivers/net/bna/bna_txrx.c:2200] Possible null pointer dereference: cq_mem
 [drivers/net/bna/bna_txrx.c:2203] Possible null pointer dereference: cq_mem
 [drivers/net/bna/bna_txrx.c:2206] Possible null pointer dereference: cq_mem
 [drivers/net/bna/bna_txrx.c:2209] Possible null pointer dereference: cq_mem
 [drivers/net/bna/bna_txrx.c:2212] Possible null pointer dereference: cq_mem
 [drivers/net/bna/bna_txrx.c:2215] Possible null pointer dereference: cq_mem
 [drivers/net/bna/bna_txrx.c:2218] Possible null pointer dereference: cq_mem
 [drivers/net/bna/bna_txrx.c:2221] Possible null pointer dereference: cq_mem
 [drivers/net/bna/bna_txrx.c:3403] Possible null pointer dereference: q_mem
 [drivers/net/bna/bna_txrx.c:3485] Possible null pointer dereference: tx_fndb
 [drivers/net/bna/bna_txrx.c:3515] Possible null pointer dereference: tx_fndb
 [drivers/net/wireless/ipw2x00/libipw_rx.c:771] Possible null pointer dereference: skb - otherwise it is redundant to check if skb is null at line 803
 [drivers/net/wireless/mwifiex/cfg80211.c:828] Possible null pointer dereference: beacon - otherwise it is redundant to check if beacon is null at line 816
 
 [drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c:769] Possible null pointer dereference: skb - otherwise it is redundant to check if skb is null at line 771
 [drivers/staging/rtl8192e/ieee80211/ieee80211_rx.c:570] Possible null pointer dereference: sub_skb - otherwise it is redundant to check if sub_skb is null at line 589
 [drivers/staging/rtl8192e/ieee80211/ieee80211_rx.c:571] Possible null pointer dereference: sub_skb - otherwise it is redundant to check if sub_skb is null at line 589
 [drivers/staging/rtl8192e/ieee80211/ieee80211_rx.c:573] Possible null pointer dereference: sub_skb - otherwise it is redundant to check if sub_skb is null at line 589
 [drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:567] Possible null pointer dereference: sub_skb - otherwise it is redundant to check if sub_skb is null at line 588
 [drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:568] Possible null pointer dereference: sub_skb - otherwise it is redundant to check if sub_skb is null at line 588
 [drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:570] Possible null pointer dereference: sub_skb - otherwise it is redundant to check if sub_skb is null at line 588
    => can skb_pull or skb_push set skb/sub_skb to null?
 
 [drivers/usb/gadget/amd5536udc.c:1125] Possible null pointer dereference: req - otherwise it is redundant to check if req is null at line 1238
 [drivers/usb/gadget/amd5536udc.c:1130] Possible null pointer dereference: req - otherwise it is redundant to check if req is null at line 1238
 [drivers/usb/gadget/fsl_udc_core.c:908] Possible null pointer dereference: req - otherwise it is redundant to check if req is null at line 927
 [drivers/usb/gadget/fsl_udc_core.c:909] Possible null pointer dereference: req - otherwise it is redundant to check if req is null at line 927
 [drivers/usb/gadget/fsl_udc_core.c:910] Possible null pointer dereference: req - otherwise it is redundant to check if req is null at line 927
 [drivers/usb/gadget/langwell_udc.c:832] Possible null pointer dereference: req - otherwise it is redundant to check if req is null at line 848
 [drivers/usb/gadget/mv_udc_core.c:770] Possible null pointer dereference: req - otherwise it is redundant to check if req is null at line 794
 [drivers/usb/gadget/mv_udc_core.c:771] Possible null pointer dereference: req - otherwise it is redundant to check if req is null at line 794
 [drivers/usb/gadget/mv_udc_core.c:772] Possible null pointer dereference: req - otherwise it is redundant to check if req is null at line 794
 [drivers/usb/gadget/pch_udc.c:1653] Possible null pointer dereference: req - otherwise it is redundant to check if req is null at line 1675
 [drivers/usb/serial/io_ti.c:2089] Possible null pointer dereference: tty - otherwise it is redundant to check if tty is null at line 2141
Personal tools