Bug 217739

Summary: sys/cddl/dev/dtrace/dtrace_debug.c: PVS-Studio: V517
Product: Base System Reporter: Svyatoslav <razmyslov>
Component: kernAssignee: Mark Johnston <markj>
Status: Closed FIXED    
Severity: Affects Many People CC: emaste, markj
Priority: --- Keywords: patch
Version: CURRENT   
Hardware: Any   
OS: Any   
Description Flags
git patch none

Description Svyatoslav 2017-03-13 11:37:54 UTC
Created attachment 180764 [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: V517 The use of 'if (A) {...} else if (A) {...}' pattern was detected. There is a probability of logical error presence. Check lines: 102, 109. dtrace_debug.c 102
Comment 1 commit-hook freebsd_committer 2017-03-13 18:44:00 UTC
A commit references this bug:

Author: markj
Date: Mon Mar 13 18:43:00 UTC 2017
New revision: 315208
URL: https://svnweb.freebsd.org/changeset/base/315208

  Fix a backwards comparison in the code to dump a DTrace debug buffer.

  PR:		217739
  MFC after:	1 week

Comment 2 Mark Johnston freebsd_committer 2017-07-27 21:43:10 UTC
I MFCed this to stable/11 in r316712 but forgot to tag the PR.