All of lore.kernel.org
 help / color / mirror / Atom feed
* [frank-w-bpi-r2-4.14:5.13-r64-fan 17/19] drivers/net/wireless/mediatek/mt76/eeprom.c:48:24: sparse: sparse: Using plain integer as NULL pointer
@ 2021-06-30 16:54 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-06-30 16:54 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 2764 bytes --]

tree:   https://github.com/frank-w/BPI-R2-4.14 5.13-r64-fan
head:   35be5bf3893a16d6cd58677504347aea81e31980
commit: 8c2a131d23a7b282685c4bb7911147147ee5f715 [17/19] mt76: allow loading eeprom from file (WIP)
config: x86_64-randconfig-s022-20210630 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-341-g8af24329-dirty
        # https://github.com/frank-w/BPI-R2-4.14/commit/8c2a131d23a7b282685c4bb7911147147ee5f715
        git remote add frank-w-bpi-r2-4.14 https://github.com/frank-w/BPI-R2-4.14
        git fetch --no-tags frank-w-bpi-r2-4.14 5.13-r64-fan
        git checkout 8c2a131d23a7b282685c4bb7911147147ee5f715
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/net/wireless/mediatek/mt76/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)
>> drivers/net/wireless/mediatek/mt76/eeprom.c:48:24: sparse: sparse: Using plain integer as NULL pointer

vim +48 drivers/net/wireless/mediatek/mt76/eeprom.c

    11	
    12	static int
    13	mt76_get_eeprom_file(struct mt76_dev *dev, int len)
    14	{
    15		char path[64]="";
    16		struct file *fp;
    17		loff_t pos=0;
    18		int ret;
    19		struct inode *inode = NULL;
    20		loff_t size;
    21	
    22		ret = snprintf(path,sizeof(path),"/lib/firmware/mediatek/%s_rf.bin",dev->dev->driver->name);
    23		if(ret<0)
    24			return -EINVAL;
    25		dev_info(dev->dev,"Load eeprom: %s\n",path);
    26		fp = filp_open(path, O_RDONLY, 0);
    27		if (IS_ERR(fp)) {
    28			dev_info(dev->dev,"Open eeprom file failed: %s\n",path);
    29			return -ENOENT;
    30		}
    31	
    32		inode = file_inode(fp);
    33		if ((!S_ISREG(inode->i_mode) && !S_ISBLK(inode->i_mode))) {
    34			printk(KERN_ALERT "invalid file type: %s\n", path);
    35			return -ENOENT;
    36		}
    37		size = i_size_read(inode->i_mapping->host);
    38		if (size < 0)
    39		{
    40			printk(KERN_ALERT "failed getting size of %s size:%lld \n",path,size);
    41			return -ENOENT;
    42		}
    43		ret = kernel_read(fp, dev->eeprom.data, len, &pos);
    44		if(ret < size){
    45			dev_info(dev->dev,"Load eeprom ERR, count %d byte (len:%d)\n",ret,len);
    46			return -ENOENT;
    47		}
  > 48		filp_close(fp, 0);
    49		dev_info(dev->dev,"Load eeprom OK, count %d byte\n",ret);
    50	
    51		return 0;
    52	}
    53	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 45880 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-30 16:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-30 16:54 [frank-w-bpi-r2-4.14:5.13-r64-fan 17/19] drivers/net/wireless/mediatek/mt76/eeprom.c:48:24: sparse: sparse: Using plain integer as NULL pointer kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.