Hello Veaceslav Falico,

This is a semi-automatic email about new static checker warnings.

The patch 31088a113c2a: "net: add for_each iterators through 
neighbour lower link's private" from Sep 25, 2013, leads to the 
following Smatch complaint:

net/core/dev.c:4566 netdev_lower_get_next_private()
         warn: variable dereferenced before check 'iter' (see line 4561)

net/core/dev.c
  4560  
  4561          lower = list_entry(*iter, struct netdev_adjacent, list);
                                   ^^^^^
Dereference.

  4562  
  4563          if (&lower->list == &dev->adj_list.lower)
  4564                  return NULL;
  4565  
  4566          if (iter)
                    ^^^^
Check too late.

  4567                  *iter = lower->list.next;
  4568  


The RCU version of this function has the same problem.

regards,
dan carpenter
_______________________________________________
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild

Reply via email to