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

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

tree:   https://github.com/frank-w/BPI-R2-4.14 5.15-bpi-r2-pro-drm2
head:   0ab1ef3f4d5eae2229584acdde09e8ea708fc052
commit: 1134cbecda5b146283bf738fc325a90013af97d6 [19/88] mt76: allow loading eeprom from file
config: i386-randconfig-s001-20211015 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.4-dirty
        # https://github.com/frank-w/BPI-R2-4.14/commit/1134cbecda5b146283bf738fc325a90013af97d6
        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.15-bpi-r2-pro-drm2
        git checkout 1134cbecda5b146283bf738fc325a90013af97d6
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=i386 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: 35150 bytes --]

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

only message in thread, other threads:[~2021-10-22  5:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-22  5:48 [frank-w-bpi-r2-4.14:5.15-bpi-r2-pro-drm2 19/88] 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.