linux/drivers/net/wireless/ath/wil6210
Vladimir Kondratiev 867fa0d49c wil6210: fix PTR_ERR() usage after initialization to constant
Reported by coccinelle:

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next.git master
head:   6a5d088a92
commit: b7cde47009 [18/80] wil6210: convert debugfs to the table mode

coccinelle warnings: (new ones prefixed by >>)

>> drivers/net/wireless/ath/wil6210/debugfs.c:327:17-24: ERROR: PTR_ERR applied after initialization to constant on line 304

vim +327 drivers/net/wireless/ath/wil6210/debugfs.c

   298                                          struct dentry *dbg, void *base,
   299                                          const struct dbg_off * const tbl)
   300  {
   301          int i;
   302
   303          for (i = 0; tbl[i].name; i++) {

 > 304                  struct dentry *f = NULL;
   305
   306                  switch (tbl[i].type) {
   307                  case doff_u32:
   308                          f = debugfs_create_u32(tbl[i].name, tbl[i].mode, dbg,
   309                                                 base + tbl[i].off);
   310                          break;
   311                  case doff_x32:
   312                          f = debugfs_create_x32(tbl[i].name, tbl[i].mode, dbg,
   313                                                 base + tbl[i].off);
   314                          break;
   315                  case doff_ulong:
   316                          f = wil_debugfs_create_ulong(tbl[i].name, tbl[i].mode,
   317                                                       dbg, base + tbl[i].off);
   318                          break;
   319                  case doff_io32:
   320                          f = wil_debugfs_create_iomem_x32(tbl[i].name,
   321                                                           tbl[i].mode, dbg,
   322                                                           base + tbl[i].off);
   323                          break;
   324                  }
   325                  if (IS_ERR_OR_NULL(f))
   326                          wil_err(wil, "Create file \"%s\": err %ld\n",

 > 327                                  tbl[i].name, PTR_ERR(f));
   328          }
   329  }
   330

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-09-11 15:27:39 -04:00
..
cfg80211.c wil6210: fix for oops while stopping interface 2014-09-11 15:27:39 -04:00
debug.c wil6210: trace support 2013-05-22 15:08:27 -04:00
debugfs.c wil6210: fix PTR_ERR() usage after initialization to constant 2014-09-11 15:27:39 -04:00
fw_inc.c wil6210: firmware download 2014-09-11 15:27:36 -04:00
fw.c wil6210: firmware download 2014-09-11 15:27:36 -04:00
fw.h wil6210: firmware download 2014-09-11 15:27:36 -04:00
interrupt.c wil6210: fix for oops while stopping interface 2014-09-11 15:27:39 -04:00
Kconfig wil6210: platform specific module 2014-09-11 15:27:37 -04:00
main.c wil6210: fix for oops while stopping interface 2014-09-11 15:27:39 -04:00
Makefile wil6210: platform specific module 2014-09-11 15:27:37 -04:00
netdev.c wil6210: enlarge TX/RX buffer length 2014-09-11 15:27:38 -04:00
pcie_bus.c wil6210: fix for oops while stopping interface 2014-09-11 15:27:39 -04:00
rx_reorder.c wil6210: fix race condition between BACK event and Rx data 2014-09-11 15:27:38 -04:00
trace.c wil6210: trace support 2013-05-22 15:08:27 -04:00
trace.h wil6210: Align WMI header with latest FW 2013-07-22 16:54:37 -04:00
txrx.c wil6210: enlarge TX/RX buffer length 2014-09-11 15:27:38 -04:00
txrx.h wil6210: enlarge TX/RX buffer length 2014-09-11 15:27:38 -04:00
wil6210.h wil6210: fix for oops while stopping interface 2014-09-11 15:27:39 -04:00
wil_platform_msm.c wil6210: platform specific module 2014-09-11 15:27:37 -04:00
wil_platform_msm.h wil6210: platform specific module 2014-09-11 15:27:37 -04:00
wil_platform.c wil6210: platform specific module 2014-09-11 15:27:37 -04:00
wil_platform.h wil6210: platform specific module 2014-09-11 15:27:37 -04:00
wmi.c wil6210: introduce separate completion for WMI 2014-09-11 15:27:38 -04:00
wmi.h wil6210: coding style fixes 2014-09-11 15:27:36 -04:00