Re: [cgroup:for-next 16/18] kernel/cgroup/rdma.c:526:4: warning: 'value' may be used uninitialized in this function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I reviewed the code. value initializing to zero is required. Sending
the incremental patch.

Parav

On Tue, Jan 10, 2017 at 11:20 AM, kbuild test robot
<fengguang.wu@xxxxxxxxx> wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git for-next
> head:   9c1e67f941019907034d7e5584c891603cce2d8e
> commit: 39d3e7584a686541a3295ff1624d341e669e1afc [16/18] rdmacg: Added rdma cgroup controller
> config: ia64-allmodconfig (attached as .config)
> compiler: ia64-linux-gcc (GCC) 6.2.0
> reproduce:
>         wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         git checkout 39d3e7584a686541a3295ff1624d341e669e1afc
>         # save the attached .config to linux build tree
>         make.cross ARCH=ia64
>
> Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
> http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings
>
> All warnings (new ones prefixed by >>):
>
>    kernel/cgroup/rdma.c: In function 'rdmacg_resource_read':
>>> kernel/cgroup/rdma.c:526:4: warning: 'value' may be used uninitialized in this function [-Wmaybe-uninitialized]
>        seq_printf(sf, "%d", value);
>        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
>    kernel/cgroup/rdma.c:506:6: note: 'value' was declared here
>      u32 value;
>          ^~~~~
>
> vim +/value +526 kernel/cgroup/rdma.c
>
>    510          for (i = 0; i < RDMACG_RESOURCE_MAX; i++) {
>    511                  seq_puts(sf, rdmacg_resource_names[i]);
>    512                  seq_putc(sf, '=');
>    513                  if (sf_type == RDMACG_RESOURCE_TYPE_MAX) {
>    514                          if (rpool)
>    515                                  value = rpool->resources[i].max;
>    516                          else
>    517                                  value = S32_MAX;
>    518                  } else {
>    519                          if (rpool)
>    520                                  value = rpool->resources[i].usage;
>    521                  }
>    522
>    523                  if (value == S32_MAX)
>    524                          seq_puts(sf, RDMACG_MAX_STR);
>    525                  else
>  > 526                          seq_printf(sf, "%d", value);
>    527                  seq_putc(sf, ' ');
>    528          }
>    529  }
>    530
>    531  static int rdmacg_resource_read(struct seq_file *sf, void *v)
>    532  {
>    533          struct rdmacg_device *device;
>    534          struct rdmacg_resource_pool *rpool;
>
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
--
To unsubscribe from this list: send the line "unsubscribe cgroups" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [Monitors]

  Powered by Linux