* [rmk-arm:clearfog 2/13] drivers/net/dsa/mv88e6xxx/mv88e6xxx_debugfs.c:739:6: warning: %d in format string (no. 1) requires 'int *' but the argument type is 'unsigned int *'. [invalidScanfArgType_int]
@ 2021-10-24 22:43 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-10-24 22:43 UTC (permalink / raw)
To: Russell King; +Cc: kbuild-all, linux-kernel
Hi Russell,
First bad commit (maybe != root cause):
tree: git://git.armlinux.org.uk/~rmk/linux-arm clearfog
head: 89b5c2c2bea4a97b0c6254f54d3719fe15c9e38e
commit: ee71c167800c79ed367a6cb8d0efb4e2cfffabf7 [2/13] net: dsa: mv88e6xxx: debugfs hacks to fix the compile
compiler: sh4-linux-gcc (GCC) 11.2.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
cppcheck possible warnings: (new ones prefixed by >>, may not real problems)
>> drivers/net/dsa/mv88e6xxx/mv88e6xxx_debugfs.c:162:8: warning: sscanf() without field width limits can crash with huge input data. [invalidscanf]
ret = sscanf(cmd, "%s %x %x", name, ®, &val);
^
vim +739 drivers/net/dsa/mv88e6xxx/mv88e6xxx_debugfs.c
3724260d6f3b5e Vivien Didelot 2015-10-22 725
3724260d6f3b5e Vivien Didelot 2015-10-22 726 static ssize_t mv88e6xxx_pvt_write(struct file *file, const char __user *buf,
3724260d6f3b5e Vivien Didelot 2015-10-22 727 size_t count, loff_t *ppos)
3724260d6f3b5e Vivien Didelot 2015-10-22 728 {
3724260d6f3b5e Vivien Didelot 2015-10-22 729 struct seq_file *s = file->private_data;
3724260d6f3b5e Vivien Didelot 2015-10-22 730 struct mv88e6xxx_chip *chip = s->private;
3724260d6f3b5e Vivien Didelot 2015-10-22 731 const u16 mask = (1 << mv88e6xxx_num_ports(chip)) - 1;
3724260d6f3b5e Vivien Didelot 2015-10-22 732 char cmd[32];
3724260d6f3b5e Vivien Didelot 2015-10-22 733 unsigned int src_dev, src_port, pvlan;
3724260d6f3b5e Vivien Didelot 2015-10-22 734 int ret;
3724260d6f3b5e Vivien Didelot 2015-10-22 735
3724260d6f3b5e Vivien Didelot 2015-10-22 736 if (copy_from_user(cmd, buf, sizeof(cmd)))
3724260d6f3b5e Vivien Didelot 2015-10-22 737 return -EFAULT;
3724260d6f3b5e Vivien Didelot 2015-10-22 738
3724260d6f3b5e Vivien Didelot 2015-10-22 @739 if (sscanf(cmd, "%d %d %x", &src_dev, &src_port, &pvlan) != 3)
3724260d6f3b5e Vivien Didelot 2015-10-22 740 return -EINVAL;
3724260d6f3b5e Vivien Didelot 2015-10-22 741
3724260d6f3b5e Vivien Didelot 2015-10-22 742 if (src_dev >= 32 || src_port >= 16 || pvlan & ~mask)
3724260d6f3b5e Vivien Didelot 2015-10-22 743 return -ERANGE;
3724260d6f3b5e Vivien Didelot 2015-10-22 744
3724260d6f3b5e Vivien Didelot 2015-10-22 745 mutex_lock(&chip->reg_lock);
3724260d6f3b5e Vivien Didelot 2015-10-22 746 ret = _mv88e6xxx_pvt_write(chip, src_dev, src_port, pvlan);
3724260d6f3b5e Vivien Didelot 2015-10-22 747 mutex_unlock(&chip->reg_lock);
3724260d6f3b5e Vivien Didelot 2015-10-22 748
3724260d6f3b5e Vivien Didelot 2015-10-22 749 return ret < 0 ? ret : count;
3724260d6f3b5e Vivien Didelot 2015-10-22 750 }
3724260d6f3b5e Vivien Didelot 2015-10-22 751
:::::: The code at line 739 was first introduced by commit
:::::: 3724260d6f3b5e821ce7ead6410416bf02c3fff6 net: dsa: mv88e6xxx: add debugfs interface
:::::: TO: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
:::::: CC: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-10-24 22:43 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-24 22:43 [rmk-arm:clearfog 2/13] drivers/net/dsa/mv88e6xxx/mv88e6xxx_debugfs.c:739:6: warning: %d in format string (no. 1) requires 'int *' but the argument type is 'unsigned int *'. [invalidScanfArgType_int] kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).