]> git.baikalelectronics.ru Git - kernel.git/commit
ntb_tool: Fix infinite loop bug when writing spad/peer_spad file
authorLogan Gunthorpe <logang@deltatee.com>
Fri, 27 May 2016 20:38:31 +0000 (14:38 -0600)
committerJon Mason <jdmason@kudzu.us>
Fri, 5 Aug 2016 14:05:31 +0000 (10:05 -0400)
commite0a846c6bb6b5ea6e6720196fc8a77b916a856ac
tree287e02e1f7945fbb24826f002177be36513a2e69
parentb40d6b88aca64f2d8cb0d162f730b6c6a1f14064
ntb_tool: Fix infinite loop bug when writing spad/peer_spad file

If you tried to write two spads in one line, as per the example:

root@peer# echo '0 0x01010101 1 0x7f7f7f7f' > $DBG_DIR/peer_spad

then the CPU would freeze in an infinite loop.

This wasn't immediately obvious but 'pos' was not incrementing the
buffer, so after reading the second pair of values, 'pos' would once
again be 3 and it would re-read the second pair of values ad infinitum.

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Acked-by: Allen Hubbe <Allen.Hubbe@emc.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
drivers/ntb/test/ntb_tool.c