]> git.baikalelectronics.ru Git - kernel.git/commit
ionic: check for binary values in FW ver string
authorShannon Nelson <snelson@pensando.io>
Fri, 1 Oct 2021 18:05:52 +0000 (11:05 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 2 Oct 2021 13:00:21 +0000 (14:00 +0100)
commitcf00c3d52f93f8f96e986fe7e39ed84ec23af6d6
tree6d6ff95657a1c06e754cf0f19157bccd4509fde5
parentb13ce2cbf9ea3ff9ea9839b4268b91fd8cd9a51b
ionic: check for binary values in FW ver string

If the PCI connection is broken, reading the FW version string
will only get 0xff bytes, which shouldn't get printed.  This
checks the first byte and prints only the first 4 bytes
if non-ASCII.

Also, add a limit to the string length printed when a valid
string is found, just in case it is not properly terminated.

Signed-off-by: Shannon Nelson <snelson@pensando.io>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/pensando/ionic/ionic_main.c