From: Dan Carpenter <dan.carpenter@oracle.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: Mon, 30 Nov 2020 15:32:31 +0300 [thread overview]
Message-ID: <20201130123231.GD2767@kadam> (raw)
[-- Attachment #1: Type: text/plain, Size: 4340 bytes --]
tree: https://github.com/jpirko/linux_mlxsw petrm_resilient
head: f89604f4fb4130335e42ccf65a969ad0a0f58166
commit: f89604f4fb4130335e42ccf65a969ad0a0f58166 [5/5] debugfs for nexthop [xxx]
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 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;
"err" not set on this path.
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;
^^^
Uninitialized.
f89604f4fb41303 Petr Machata 2020-11-19 2639 }
---
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 --]
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild-all@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: Mon, 30 Nov 2020 15:32:31 +0300 [thread overview]
Message-ID: <20201130123231.GD2767@kadam> (raw)
[-- Attachment #1: Type: text/plain, Size: 4340 bytes --]
tree: https://github.com/jpirko/linux_mlxsw petrm_resilient
head: f89604f4fb4130335e42ccf65a969ad0a0f58166
commit: f89604f4fb4130335e42ccf65a969ad0a0f58166 [5/5] debugfs for nexthop [xxx]
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 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;
"err" not set on this path.
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;
^^^
Uninitialized.
f89604f4fb41303 Petr Machata 2020-11-19 2639 }
---
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 --]
next reply other threads:[~2020-11-30 12:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-30 12:32 Dan Carpenter [this message]
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
-- strict thread matches above, loose matches on Subject: below --
2020-11-20 7:39 kernel test robot
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=20201130123231.GD2767@kadam \
--to=dan.carpenter@oracle.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.