All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: [jpirko-mlxsw:petrm_resilient 5/5] net/ipv4/nexthop.c:2638 nexthop_dfs_bucket_activity_write() error: uninitialized symbol 'err'.
Date: Fri, 20 Nov 2020 15:39:07 +0800	[thread overview]
Message-ID: <202011201505.SyIXk1XF-lkp@intel.com> (raw)

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

CC: kbuild-all(a)lists.01.org
TO: Petr Machata <me@pmachata.org>

tree:   https://github.com/jpirko/linux_mlxsw petrm_resilient
head:   f89604f4fb4130335e42ccf65a969ad0a0f58166
commit: f89604f4fb4130335e42ccf65a969ad0a0f58166 [5/5] debugfs for nexthop [xxx]
:::::: branch date: 14 hours ago
:::::: commit date: 14 hours ago
config: i386-randconfig-m021-20201120 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

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

smatch warnings:
net/ipv4/nexthop.c:2638 nexthop_dfs_bucket_activity_write() error: uninitialized symbol 'err'.

vim +/err +2638 net/ipv4/nexthop.c

f89604f4fb41303 Petr Machata 2020-11-19  2588  
f89604f4fb41303 Petr Machata 2020-11-19  2589  static ssize_t nexthop_dfs_bucket_activity_write(struct file *file,
f89604f4fb41303 Petr Machata 2020-11-19  2590  						 const char __user *user_buf,
f89604f4fb41303 Petr Machata 2020-11-19  2591  						 size_t size, loff_t *ppos)
f89604f4fb41303 Petr Machata 2020-11-19  2592  {
f89604f4fb41303 Petr Machata 2020-11-19  2593  	const char *tok_bucketid;
f89604f4fb41303 Petr Machata 2020-11-19  2594  	const char *tok_nhid;
f89604f4fb41303 Petr Machata 2020-11-19  2595  	struct nexthop *nh;
f89604f4fb41303 Petr Machata 2020-11-19  2596  	loff_t pos = *ppos;
f89604f4fb41303 Petr Machata 2020-11-19  2597  	char buf[128];
f89604f4fb41303 Petr Machata 2020-11-19  2598  	u16 bucketid; // xxx or u32 if we choose so
f89604f4fb41303 Petr Machata 2020-11-19  2599  	char *ptr;
f89604f4fb41303 Petr Machata 2020-11-19  2600  	u32 nhid;
f89604f4fb41303 Petr Machata 2020-11-19  2601  	int err;
f89604f4fb41303 Petr Machata 2020-11-19  2602  
f89604f4fb41303 Petr Machata 2020-11-19  2603  	if (pos < 0)
f89604f4fb41303 Petr Machata 2020-11-19  2604  		return -EINVAL;
f89604f4fb41303 Petr Machata 2020-11-19  2605  	if (pos == size)
f89604f4fb41303 Petr Machata 2020-11-19  2606  		goto skip;
f89604f4fb41303 Petr Machata 2020-11-19  2607  	if (pos)
f89604f4fb41303 Petr Machata 2020-11-19  2608  		return -EINVAL;
f89604f4fb41303 Petr Machata 2020-11-19  2609  	if (size > sizeof(buf))
f89604f4fb41303 Petr Machata 2020-11-19  2610  		return -ENOMEM;
f89604f4fb41303 Petr Machata 2020-11-19  2611          if (copy_from_user(buf, user_buf, size))
f89604f4fb41303 Petr Machata 2020-11-19  2612                  return -EFAULT;
f89604f4fb41303 Petr Machata 2020-11-19  2613  
f89604f4fb41303 Petr Machata 2020-11-19  2614  	buf[sizeof(buf) - 1] = '\0';
f89604f4fb41303 Petr Machata 2020-11-19  2615  	ptr = buf;
f89604f4fb41303 Petr Machata 2020-11-19  2616  	tok_nhid = strsep(&ptr, " \t");
f89604f4fb41303 Petr Machata 2020-11-19  2617  	tok_bucketid = strsep(&ptr, " \t");
f89604f4fb41303 Petr Machata 2020-11-19  2618  
f89604f4fb41303 Petr Machata 2020-11-19  2619  	if (!tok_nhid || !tok_bucketid || ptr)
f89604f4fb41303 Petr Machata 2020-11-19  2620  		return -EINVAL;
f89604f4fb41303 Petr Machata 2020-11-19  2621  
f89604f4fb41303 Petr Machata 2020-11-19  2622  	err = kstrtou32(tok_nhid, 0, &nhid);
f89604f4fb41303 Petr Machata 2020-11-19  2623  	if (err)
f89604f4fb41303 Petr Machata 2020-11-19  2624  		return err;
f89604f4fb41303 Petr Machata 2020-11-19  2625  
f89604f4fb41303 Petr Machata 2020-11-19  2626  	err = kstrtou16(tok_bucketid, 0, &bucketid);
f89604f4fb41303 Petr Machata 2020-11-19  2627  	if (err)
f89604f4fb41303 Petr Machata 2020-11-19  2628  		return err;
f89604f4fb41303 Petr Machata 2020-11-19  2629  
f89604f4fb41303 Petr Machata 2020-11-19  2630  	rcu_read_lock();
f89604f4fb41303 Petr Machata 2020-11-19  2631  	nh = nexthop_find_by_id(&init_net, nhid);
f89604f4fb41303 Petr Machata 2020-11-19  2632  	if (!nh || !nexthop_select_path(nh, bucketid))
f89604f4fb41303 Petr Machata 2020-11-19  2633  		err = -ENOENT;
f89604f4fb41303 Petr Machata 2020-11-19  2634  	rcu_read_unlock();
f89604f4fb41303 Petr Machata 2020-11-19  2635  
f89604f4fb41303 Petr Machata 2020-11-19  2636  skip:
f89604f4fb41303 Petr Machata 2020-11-19  2637  	*ppos = size;
f89604f4fb41303 Petr Machata 2020-11-19 @2638  	return err ?: size;
f89604f4fb41303 Petr Machata 2020-11-19  2639  }
f89604f4fb41303 Petr Machata 2020-11-19  2640  

---
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: 31145 bytes --]

             reply	other threads:[~2020-11-20  7:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-20  7:39 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-11-30 12:32 [jpirko-mlxsw:petrm_resilient 5/5] net/ipv4/nexthop.c:2638 nexthop_dfs_bucket_activity_write() error: uninitialized symbol 'err' Dan Carpenter
2020-11-30 12:32 ` Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202011201505.SyIXk1XF-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.