]> git.baikalelectronics.ru Git - kernel.git/commit
net: ipa: initialize all filter table slots
authorAlex Elder <elder@linaro.org>
Tue, 7 Sep 2021 17:05:54 +0000 (12:05 -0500)
committerDavid S. Miller <davem@davemloft.net>
Wed, 8 Sep 2021 11:10:33 +0000 (12:10 +0100)
commitbb920f9efbb4d558e7f8f81e4773e6b14ad74d07
tree8dab0114736bc8ef94e8d499c80e0e8d4faa36d0
parent249600708309044f6567e339a7253f98c06b14a0
net: ipa: initialize all filter table slots

There is an off-by-one problem in ipa_table_init_add(), when
initializing filter tables.

In that function, the number of filter table entries is determined
based on the number of set bits in the filter map.  However that
count does *not* include the extra "slot" in the filter table that
holds the filter map itself.  Meanwhile, ipa_table_addr() *does*
include the filter map in the memory it returns, but because the
count it's provided doesn't include it, it includes one too few
table entries.

Fix this by including the extra slot for the filter map in the count
computed in ipa_table_init_add().

Note: ipa_filter_reset_table() does not have this problem; it resets
filter table entries one by one, but does not overwrite the filter
bitmap.

Fixes: 90626e0b961c ("soc: qcom: ipa: filter and routing tables")
Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ipa/ipa_table.c