Bug 217739 - sys/cddl/dev/dtrace/dtrace_debug.c: PVS-Studio: V517
Summary: sys/cddl/dev/dtrace/dtrace_debug.c: PVS-Studio: V517
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Many People
Assignee: Mark Johnston
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2017-03-13 11:37 UTC by Svyatoslav
Modified: 2017-07-27 21:43 UTC (History)
2 users (show)

See Also:


Attachments
git patch (468 bytes, patch)
2017-03-13 11:37 UTC, Svyatoslav
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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 freebsd_triage 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

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

  PR:		217739
  MFC after:	1 week

Changes:
  head/sys/cddl/dev/dtrace/dtrace_debug.c
Comment 2 Mark Johnston freebsd_committer freebsd_triage 2017-07-27 21:43:10 UTC
I MFCed this to stable/11 in r316712 but forgot to tag the PR.