net: Fix features skip in for_each_netdev_feature()
authorTariq Toukan <tariqt@nvidia.com>
Wed, 4 May 2022 08:09:14 +0000 (11:09 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 May 2022 08:26:47 +0000 (10:26 +0200)
commitcc22bb201d77f189bd1c920854f1412f2ae9ca38
tree5b082149c721693f578d049626c208edcf765410
parentafc080e42f8ad1128349830b6204b457dde4c190
net: Fix features skip in for_each_netdev_feature()

[ Upstream commit 85db6352fc8a158a893151baa1716463d34a20d0 ]

The find_next_netdev_feature() macro gets the "remaining length",
not bit index.
Passing "bit - 1" for the following iteration is wrong as it skips
the adjacent bit. Pass "bit" instead.

Fixes: 3b89ea9c5902 ("net: Fix for_each_netdev_feature on Big endian")
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Gal Pressman <gal@nvidia.com>
Link: https://lore.kernel.org/r/20220504080914.1918-1-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/linux/netdev_features.h