lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <201711170940.ruBzuRvb%fengguang.wu@intel.com>
Date:   Fri, 17 Nov 2017 09:15:46 +0800
From:   kbuild test robot <fengguang.wu@...el.com>
To:     Nicolai Stange <nicstange@...il.com>
Cc:     kbuild-all@...org, linux-kernel@...r.kernel.org,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: drivers/net/wireless/broadcom/b43legacy/debugfs.c:224:23: error:
 implicit declaration of function 'debugfs_real_fops'

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   cf9b0772f2e410645fece13b749bd56505b998b8
commit: 7c8d469877b16d2c1cecf101a0abb7b218db85bc debugfs: add support for more elaborate ->d_fsdata
date:   9 days ago
config: x86_64-randconfig-s1-11170747 (attached as .config)
compiler: gcc-6 (Debian 6.4.0-9) 6.4.0 20171026
reproduce:
        git checkout 7c8d469877b16d2c1cecf101a0abb7b218db85bc
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All error/warnings (new ones prefixed by >>):

   In file included from include/linux/list.h:8:0,
                    from include/linux/wait.h:6,
                    from include/linux/wait_bit.h:7,
                    from include/linux/fs.h:5,
                    from drivers/net/wireless/broadcom/b43legacy/debugfs.c:26:
   drivers/net/wireless/broadcom/b43legacy/debugfs.c: In function 'b43legacy_debugfs_read':
>> drivers/net/wireless/broadcom/b43legacy/debugfs.c:224:23: error: implicit declaration of function 'debugfs_real_fops' [-Werror=implicit-function-declaration]
     dfops = container_of(debugfs_real_fops(file),
                          ^
   include/linux/kernel.h:927:26: note: in definition of macro 'container_of'
     void *__mptr = (void *)(ptr);     \
                             ^~~
   include/linux/kernel.h:927:17: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     void *__mptr = (void *)(ptr);     \
                    ^
>> drivers/net/wireless/broadcom/b43legacy/debugfs.c:224:10: note: in expansion of macro 'container_of'
     dfops = container_of(debugfs_real_fops(file),
             ^~~~~~~~~~~~
   In file included from include/linux/linkage.h:4:0,
                    from include/linux/fs.h:4,
                    from drivers/net/wireless/broadcom/b43legacy/debugfs.c:26:
   include/linux/kernel.h:928:32: error: invalid type argument of unary '*' (have 'int')
     BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
                                   ^~~~~~
   include/linux/compiler.h:553:19: note: in definition of macro '__compiletime_assert'
      bool __cond = !(condition);    \
                      ^~~~~~~~~
   include/linux/compiler.h:576:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:46:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^~~~~~~~~~~~~~~~~~
   include/linux/kernel.h:928:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
     ^~~~~~~~~~~~~~~~
   include/linux/kernel.h:928:20: note: in expansion of macro '__same_type'
     BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
                       ^~~~~~~~~~~
>> drivers/net/wireless/broadcom/b43legacy/debugfs.c:224:10: note: in expansion of macro 'container_of'
     dfops = container_of(debugfs_real_fops(file),
             ^~~~~~~~~~~~
   include/linux/kernel.h:929:18: error: invalid type argument of unary '*' (have 'int')
        !__same_type(*(ptr), void),   \
                     ^~~~~~
   include/linux/compiler.h:553:19: note: in definition of macro '__compiletime_assert'
      bool __cond = !(condition);    \
                      ^~~~~~~~~
   include/linux/compiler.h:576:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:46:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^~~~~~~~~~~~~~~~~~
   include/linux/kernel.h:928:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
     ^~~~~~~~~~~~~~~~
   include/linux/kernel.h:929:6: note: in expansion of macro '__same_type'
        !__same_type(*(ptr), void),   \
         ^~~~~~~~~~~
>> drivers/net/wireless/broadcom/b43legacy/debugfs.c:224:10: note: in expansion of macro 'container_of'
     dfops = container_of(debugfs_real_fops(file),
             ^~~~~~~~~~~~
   In file included from include/linux/list.h:8:0,
                    from include/linux/wait.h:6,
                    from include/linux/wait_bit.h:7,
                    from include/linux/fs.h:5,
                    from drivers/net/wireless/broadcom/b43legacy/debugfs.c:26:
   drivers/net/wireless/broadcom/b43legacy/debugfs.c: In function 'b43legacy_debugfs_write':
   include/linux/kernel.h:927:17: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     void *__mptr = (void *)(ptr);     \
                    ^
   drivers/net/wireless/broadcom/b43legacy/debugfs.c:291:10: note: in expansion of macro 'container_of'
     dfops = container_of(debugfs_real_fops(file),
             ^~~~~~~~~~~~
   In file included from include/linux/linkage.h:4:0,
                    from include/linux/fs.h:4,
                    from drivers/net/wireless/broadcom/b43legacy/debugfs.c:26:
   include/linux/kernel.h:928:32: error: invalid type argument of unary '*' (have 'int')
     BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
                                   ^~~~~~
   include/linux/compiler.h:553:19: note: in definition of macro '__compiletime_assert'
      bool __cond = !(condition);    \
                      ^~~~~~~~~
   include/linux/compiler.h:576:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:46:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^~~~~~~~~~~~~~~~~~
   include/linux/kernel.h:928:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
     ^~~~~~~~~~~~~~~~
   include/linux/kernel.h:928:20: note: in expansion of macro '__same_type'
     BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
                       ^~~~~~~~~~~
   drivers/net/wireless/broadcom/b43legacy/debugfs.c:291:10: note: in expansion of macro 'container_of'
     dfops = container_of(debugfs_real_fops(file),
             ^~~~~~~~~~~~
   include/linux/kernel.h:929:18: error: invalid type argument of unary '*' (have 'int')
        !__same_type(*(ptr), void),   \
                     ^~~~~~
   include/linux/compiler.h:553:19: note: in definition of macro '__compiletime_assert'
      bool __cond = !(condition);    \
                      ^~~~~~~~~
   include/linux/compiler.h:576:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:46:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^~~~~~~~~~~~~~~~~~
   include/linux/kernel.h:928:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
     ^~~~~~~~~~~~~~~~
   include/linux/kernel.h:929:6: note: in expansion of macro '__same_type'
        !__same_type(*(ptr), void),   \
         ^~~~~~~~~~~
   drivers/net/wireless/broadcom/b43legacy/debugfs.c:291:10: note: in expansion of macro 'container_of'
     dfops = container_of(debugfs_real_fops(file),
             ^~~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +/debugfs_real_fops +224 drivers/net/wireless/broadcom/b43legacy/debugfs.c

75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   25  
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  @26  #include <linux/fs.h>
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   27  #include <linux/debugfs.h>
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   28  #include <linux/slab.h>
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   29  #include <linux/netdevice.h>
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   30  #include <linux/pci.h>
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   31  #include <linux/mutex.h>
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   32  
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   33  #include "b43legacy.h"
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   34  #include "main.h"
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   35  #include "debugfs.h"
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   36  #include "dma.h"
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   37  #include "pio.h"
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   38  #include "xmit.h"
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   39  
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   40  
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   41  /* The root directory. */
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   42  static struct dentry *rootdir;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   43  
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   44  struct b43legacy_debugfs_fops {
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   45  	ssize_t (*read)(struct b43legacy_wldev *dev, char *buf, size_t bufsize);
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   46  	int (*write)(struct b43legacy_wldev *dev, const char *buf, size_t count);
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   47  	struct file_operations fops;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   48  	/* Offset of struct b43legacy_dfs_file in struct b43legacy_dfsentry */
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   49  	size_t file_struct_offset;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   50  	/* Take wl->irq_lock before calling read/write? */
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   51  	bool take_irqlock;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   52  };
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   53  
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   54  static inline
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   55  struct b43legacy_dfs_file * fops_to_dfs_file(struct b43legacy_wldev *dev,
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   56  				       const struct b43legacy_debugfs_fops *dfops)
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   57  {
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   58  	void *p;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   59  
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   60  	p = dev->dfsentry;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   61  	p += dfops->file_struct_offset;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   62  
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   63  	return p;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   64  }
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   65  
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   66  
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   67  #define fappend(fmt, x...)	\
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   68  	do {							\
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   69  		if (bufsize - count)				\
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   70  			count += snprintf(buf + count,		\
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   71  					  bufsize - count,	\
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   72  					  fmt , ##x);		\
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   73  		else						\
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   74  			printk(KERN_ERR "b43legacy: fappend overflow\n"); \
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   75  	} while (0)
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   76  
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   77  
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   78  /* wl->irq_lock is locked */
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   79  static ssize_t tsf_read_file(struct b43legacy_wldev *dev, char *buf, size_t bufsize)
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   80  {
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   81  	ssize_t count = 0;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   82  	u64 tsf;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   83  
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   84  	b43legacy_tsf_read(dev, &tsf);
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   85  	fappend("0x%08x%08x\n",
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   86  		(unsigned int)((tsf & 0xFFFFFFFF00000000ULL) >> 32),
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   87  		(unsigned int)(tsf & 0xFFFFFFFFULL));
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   88  
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   89  	return count;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   90  }
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   91  
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   92  /* wl->irq_lock is locked */
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   93  static int tsf_write_file(struct b43legacy_wldev *dev, const char *buf, size_t count)
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   94  {
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   95  	u64 tsf;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   96  
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   97  	if (sscanf(buf, "%llu", (unsigned long long *)(&tsf)) != 1)
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   98  		return -EINVAL;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25   99  	b43legacy_tsf_write(dev, tsf);
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  100  
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  101  	return 0;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  102  }
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  103  
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  104  /* wl->irq_lock is locked */
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  105  static ssize_t ucode_regs_read_file(struct b43legacy_wldev *dev, char *buf, size_t bufsize)
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  106  {
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  107  	ssize_t count = 0;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  108  	int i;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  109  
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  110  	for (i = 0; i < 64; i++) {
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  111  		fappend("r%d = 0x%04x\n", i,
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  112  			b43legacy_shm_read16(dev, B43legacy_SHM_WIRELESS, i));
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  113  	}
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  114  
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  115  	return count;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  116  }
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  117  
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  118  /* wl->irq_lock is locked */
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  119  static ssize_t shm_read_file(struct b43legacy_wldev *dev, char *buf, size_t bufsize)
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  120  {
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  121  	ssize_t count = 0;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  122  	int i;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  123  	u16 tmp;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  124  	__le16 *le16buf = (__le16 *)buf;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  125  
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  126  	for (i = 0; i < 0x1000; i++) {
187a9dca3 drivers/net/wireless/b43legacy/debugfs.c          Stefano Brivio      2007-11-06  127  		if (bufsize < sizeof(tmp))
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  128  			break;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  129  		tmp = b43legacy_shm_read16(dev, B43legacy_SHM_SHARED, 2 * i);
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  130  		le16buf[i] = cpu_to_le16(tmp);
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  131  		count += sizeof(tmp);
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  132  		bufsize -= sizeof(tmp);
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  133  	}
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  134  
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  135  	return count;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  136  }
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  137  
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  138  static ssize_t txstat_read_file(struct b43legacy_wldev *dev, char *buf, size_t bufsize)
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  139  {
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  140  	struct b43legacy_txstatus_log *log = &dev->dfsentry->txstatlog;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  141  	ssize_t count = 0;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  142  	unsigned long flags;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  143  	int i, idx;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  144  	struct b43legacy_txstatus *stat;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  145  
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  146  	spin_lock_irqsave(&log->lock, flags);
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  147  	if (log->end < 0) {
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  148  		fappend("Nothing transmitted, yet\n");
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  149  		goto out_unlock;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  150  	}
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  151  	fappend("b43legacy TX status reports:\n\n"
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  152  		"index | cookie | seq | phy_stat | frame_count | "
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  153  		"rts_count | supp_reason | pm_indicated | "
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  154  		"intermediate | for_ampdu | acked\n" "---\n");
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  155  	i = log->end + 1;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  156  	idx = 0;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  157  	while (1) {
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  158  		if (i == B43legacy_NR_LOGGED_TXSTATUS)
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  159  			i = 0;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  160  		stat = &(log->log[i]);
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  161  		if (stat->cookie) {
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  162  			fappend("%03d | "
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  163  				"0x%04X | 0x%04X | 0x%02X | "
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  164  				"0x%X | 0x%X | "
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  165  				"%u | %u | "
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  166  				"%u | %u | %u\n",
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  167  				idx,
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  168  				stat->cookie, stat->seq, stat->phy_stat,
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  169  				stat->frame_count, stat->rts_count,
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  170  				stat->supp_reason, stat->pm_indicated,
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  171  				stat->intermediate, stat->for_ampdu,
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  172  				stat->acked);
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  173  			idx++;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  174  		}
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  175  		if (i == log->end)
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  176  			break;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  177  		i++;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  178  	}
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  179  out_unlock:
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  180  	spin_unlock_irqrestore(&log->lock, flags);
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  181  
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  182  	return count;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  183  }
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  184  
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  185  /* wl->irq_lock is locked */
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  186  static int restart_write_file(struct b43legacy_wldev *dev, const char *buf, size_t count)
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  187  {
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  188  	int err = 0;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  189  
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  190  	if (count > 0 && buf[0] == '1') {
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  191  		b43legacy_controller_restart(dev, "manually restarted");
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  192  	} else
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  193  		err = -EINVAL;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  194  
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  195  	return err;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  196  }
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  197  
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  198  #undef fappend
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  199  
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  200  static ssize_t b43legacy_debugfs_read(struct file *file, char __user *userbuf,
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  201  				size_t count, loff_t *ppos)
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  202  {
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  203  	struct b43legacy_wldev *dev;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  204  	struct b43legacy_debugfs_fops *dfops;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  205  	struct b43legacy_dfs_file *dfile;
125c5cc2c drivers/net/wireless/b43legacy/debugfs.c          Frank Lichtenheld   2007-11-24  206  	ssize_t uninitialized_var(ret);
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  207  	char *buf;
d8004cb92 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2008-12-09  208  	const size_t bufsize = 1024 * 16; /* 16 KiB buffer */
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  209  	const size_t buforder = get_order(bufsize);
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  210  	int err = 0;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  211  
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  212  	if (!count)
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  213  		return 0;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  214  	dev = file->private_data;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  215  	if (!dev)
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  216  		return -ENODEV;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  217  
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  218  	mutex_lock(&dev->wl->mutex);
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  219  	if (b43legacy_status(dev) < B43legacy_STAT_INITIALIZED) {
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  220  		err = -ENODEV;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  221  		goto out_unlock;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  222  	}
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  223  
9c4a45b17 drivers/net/wireless/broadcom/b43legacy/debugfs.c Christian Lamparter 2016-09-17 @224  	dfops = container_of(debugfs_real_fops(file),
9c4a45b17 drivers/net/wireless/broadcom/b43legacy/debugfs.c Christian Lamparter 2016-09-17  225  			     struct b43legacy_debugfs_fops, fops);
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  226  	if (!dfops->read) {
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  227  		err = -ENOSYS;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  228  		goto out_unlock;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  229  	}
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  230  	dfile = fops_to_dfs_file(dev, dfops);
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  231  
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  232  	if (!dfile->buffer) {
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  233  		buf = (char *)__get_free_pages(GFP_KERNEL, buforder);
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  234  		if (!buf) {
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  235  			err = -ENOMEM;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  236  			goto out_unlock;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  237  		}
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  238  		memset(buf, 0, bufsize);
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  239  		if (dfops->take_irqlock) {
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  240  			spin_lock_irq(&dev->wl->irq_lock);
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  241  			ret = dfops->read(dev, buf, bufsize);
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  242  			spin_unlock_irq(&dev->wl->irq_lock);
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  243  		} else
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  244  			ret = dfops->read(dev, buf, bufsize);
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  245  		if (ret <= 0) {
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  246  			free_pages((unsigned long)buf, buforder);
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  247  			err = ret;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  248  			goto out_unlock;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  249  		}
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  250  		dfile->data_len = ret;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  251  		dfile->buffer = buf;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  252  	}
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  253  
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  254  	ret = simple_read_from_buffer(userbuf, count, ppos,
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  255  				      dfile->buffer,
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  256  				      dfile->data_len);
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  257  	if (*ppos >= dfile->data_len) {
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  258  		free_pages((unsigned long)dfile->buffer, buforder);
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  259  		dfile->buffer = NULL;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  260  		dfile->data_len = 0;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  261  	}
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  262  out_unlock:
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  263  	mutex_unlock(&dev->wl->mutex);
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  264  
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  265  	return err ? err : ret;
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  266  }
75388acd0 drivers/net/wireless/b43legacy/debugfs.c          Larry Finger        2007-09-25  267  

:::::: The code at line 224 was first introduced by commit
:::::: 9c4a45b17e094a090e96beb1138e34c2a10c6b8c b43legacy: fix debugfs crash

:::::: TO: Christian Lamparter <chunkeey@...glemail.com>
:::::: CC: Greg Kroah-Hartman <gregkh@...uxfoundation.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Download attachment ".config.gz" of type "application/gzip" (29743 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ