]> git.baikalelectronics.ru Git - kernel.git/commit
net: ipa: fix init header command validation
authorAlex Elder <elder@linaro.org>
Sat, 20 Mar 2021 14:17:28 +0000 (09:17 -0500)
committerDavid S. Miller <davem@davemloft.net>
Sun, 21 Mar 2021 01:53:41 +0000 (18:53 -0700)
commitecaddf3517869877bbb10f0c307bbec626d7cc72
tree5166ffbf6e447daf06da1e57a400e30ce27b01f6
parent72f4213ec11908b3710a2171af01dfc4de8e0cbb
net: ipa: fix init header command validation

We use ipa_cmd_header_valid() to ensure certain values we will
program into hardware are within range, well in advance of when we
actually program them.  This way we avoid having to check for errors
when we actually program the hardware.

Unfortunately the dev_err() call for a bad offset value does not
supply the arguments to match the format specifiers properly.
Fix this.

There was also supposed to be a check to ensure the size to be
programmed fits in the field that holds it.  Add this missing check.

Rearrange the way we ensure the header table fits in overall IPA
memory range.

Finally, update ipa_cmd_table_valid() so the format of messages
printed for errors matches what's done in ipa_cmd_header_valid().

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ipa/ipa_cmd.c