]> git.baikalelectronics.ru Git - kernel.git/commit
net: fib_notifier: don't return positive values on fib registration
authorVlad Buslov <vladbu@nvidia.com>
Thu, 11 Feb 2021 10:07:59 +0000 (12:07 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 11 Feb 2021 22:42:43 +0000 (14:42 -0800)
commit8e9290c5c00d0a3dfba37129d5903e55605bebf2
tree0d1015a35cf1775a7f462b954acb509423461c5b
parent1538adb3426eae9ba07b923483bacccb9e384b9f
net: fib_notifier: don't return positive values on fib registration

The function fib6_walk_continue() cannot return a positive value when
called from register_fib_notifier(), but ignoring causes static analyzer to
generate warnings in users of register_fib_notifier() that try to convert
returned error code to pointer with ERR_PTR(). Handle such case by
explicitly checking for positive error values and converting them to
-EINVAL in fib6_tables_dump().

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Suggested-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Vlad Buslov <vladbu@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/ip6_fib.c