Bug 217783

Summary: sys/dev/cyapa/cyapa.c: PVS-Studio: V778 Two similar code fragments were found. Perhaps, this is a typo and 'cap_resy' variable should be used instead of 'cap_resx'.
Product: Base System Reporter: Svyatoslav <razmyslov>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Many People CC: emaste, grembo
Priority: --- Keywords: patch
Version: CURRENT   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
git patch none

Description Svyatoslav 2017-03-14 13:29:26 UTC
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
Comment 1 Michael Gmelin freebsd_committer freebsd_triage 2017-08-08 13:22:20 UTC
Looks reasonable
Comment 2 Michael Gmelin freebsd_committer freebsd_triage 2017-08-08 13:28:11 UTC
Fixed in current, thank you for providing the patch. Will MFC to 11 as well.
Comment 3 commit-hook freebsd_committer freebsd_triage 2017-08-08 13:28:17 UTC
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