+Mark Salyzyn
Julia,
Thanks for the analysis. It probably popped up in 0-day because this
patch was recently cherry-picked into the android-4.19 branch.
-Todd
On Fri, Apr 17, 2020 at 10:05 AM Julia Lawall <julia.lawall(a)inria.fr> wrote:
>
> If the iteration on line 456 reaches the end of the list, cell will be an
> invalid value somewhere in the middle of or above the list head.
>
> The initialization of cell to NULL is also unnecessary, since no one will
> ever see that value.
>
> This seems to be quite old code. I don't know why the error is showing up
> now
>
> julia
>
> ---------- Forwarded message ----------
> Date: Fri, 17 Apr 2020 10:44:42 +0800
> From: kbuild test robot <lkp(a)intel.com>
> To: kbuild(a)lists.01.org
> Cc: lkp(a)intel.com, Julia Lawall <julia.lawall(a)lip6.fr>
> Subject: [android-common:android-4.19 1/3] drivers/nvmem/core.c:462:8-12: ERROR:
> invalid reference to the index variable of the iterator on line 456
>
> CC: kbuild-all(a)lists.01.org
> TO: cros-kernel-buildreports(a)googlegroups.com
>
> tree:
https://android.googlesource.com/kernel/common android-4.19
> head: 824a6c4cdf73abdd188b5a1e55fba7c63e18ea81
> commit: 0fc0aae624eca1b9f56a962628c36b8b8829afa0 [1/3] BACKPORT: nvmem: resolve cells
from DT at registration time
> :::::: branch date: 7 weeks ago
> :::::: commit date: 7 weeks ago
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kbuild test robot <lkp(a)intel.com>
> Reported-by: Julia Lawall <julia.lawall(a)lip6.fr>
>
>
> coccinelle warnings: (new ones prefixed by >>)
>
> >> drivers/nvmem/core.c:462:8-12: ERROR: invalid reference to the index
variable of the iterator on line 456
>
> git remote add android-common
https://android.googlesource.com/kernel/common
> git remote update android-common
> git checkout 0fc0aae624eca1b9f56a962628c36b8b8829afa0
> vim +462 drivers/nvmem/core.c
>
> b6c217ab9be689 Andrew Lunn 2016-02-26 448
> 0fc0aae624eca1 Bartosz Golaszewski 2018-09-21 449 static struct nvmem_cell *
> 0fc0aae624eca1 Bartosz Golaszewski 2018-09-21 450 nvmem_find_cell_by_index(struct
nvmem_device *nvmem, int index)
> 0fc0aae624eca1 Bartosz Golaszewski 2018-09-21 451 {
> 0fc0aae624eca1 Bartosz Golaszewski 2018-09-21 452 struct nvmem_cell *cell =
NULL;
> 0fc0aae624eca1 Bartosz Golaszewski 2018-09-21 453 int i = 0;
> 0fc0aae624eca1 Bartosz Golaszewski 2018-09-21 454
> 0fc0aae624eca1 Bartosz Golaszewski 2018-09-21 455
mutex_lock(&nvmem_mutex);
> 0fc0aae624eca1 Bartosz Golaszewski 2018-09-21 @456 list_for_each_entry(cell,
&nvmem_cells, node) {
> 0fc0aae624eca1 Bartosz Golaszewski 2018-09-21 457 if (index == i++)
> 0fc0aae624eca1 Bartosz Golaszewski 2018-09-21 458 break;
> 0fc0aae624eca1 Bartosz Golaszewski 2018-09-21 459 }
> 0fc0aae624eca1 Bartosz Golaszewski 2018-09-21 460
mutex_unlock(&nvmem_mutex);
> 0fc0aae624eca1 Bartosz Golaszewski 2018-09-21 461
> 0fc0aae624eca1 Bartosz Golaszewski 2018-09-21 @462 return cell;
> 0fc0aae624eca1 Bartosz Golaszewski 2018-09-21 463 }
> 0fc0aae624eca1 Bartosz Golaszewski 2018-09-21 464
>
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
>
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
>
> --
> You received this message because you are subscribed to the Google Groups
"cros-kernel-buildreports" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
cros-kernel-buildreports+unsubscribe(a)googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/cros-kernel-buildreports/alpine.DEB.2.2....