Created attachment 180816 [details] git patch We have found and fixed a bug using PVS-Studio tool. PVS-Studio is a static code analyzer for C, C++ and C#: https://www.viva64.com/en/pvs-studio/ Analyzer warning: V778 Two similar code fragments were found. Perhaps, this is a typo and 'cap_resy' variable should be used instead of 'cap_resx'. cyapa.c 1458
Looks reasonable
Fixed in current, thank you for providing the patch. Will MFC to 11 as well.
A commit references this bug: Author: grembo Date: Tue Aug 8 13:27:32 UTC 2017 New revision: 322253 URL: https://svnweb.freebsd.org/changeset/base/322253 Log: Fix typo in cyapa out of bounds check. PR: 217783 Submitted by: razmyslov@viva64.com MFC after: 1 week Changes: head/sys/dev/cyapa/cyapa.c