Bug 217784 - sys/dev/wi/if_wi_pci.c: PVS-Studio: Dead Code (CWE-561)
Summary: sys/dev/wi/if_wi_pci.c: PVS-Studio: Dead Code (CWE-561)
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-net mailing list
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2017-03-14 13:33 UTC by Svyatoslav
Modified: 2017-03-18 13:59 UTC (History)
1 user (show)

See Also:


Attachments
git patch (355 bytes, patch)
2017-03-14 13:33 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-14 13:33:53 UTC
Created attachment 180817 [details]
git patch

We have found and fixed a weakness 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: V779 Unreachable code detected. It is possible that an error is present. if_wi_pci.c 258
Comment 1 commit-hook freebsd_committer 2017-03-15 09:32:40 UTC
A commit references this bug:

Author: kevlo
Date: Wed Mar 15 09:31:58 UTC 2017
New revision: 315294
URL: https://svnweb.freebsd.org/changeset/base/315294

Log:
  Fix unreachable code in wi_pci_resume().

  PR:	217784
  Submitted by:	Svyatoslav <razmyslov at viva64.com>
  Found by:	PVS-Studio

Changes:
  head/sys/dev/wi/if_wi_pci.c
Comment 2 Kevin Lo freebsd_committer 2017-03-15 09:34:00 UTC
Committed in r315294, thanks.
Comment 3 commit-hook freebsd_committer 2017-03-18 13:59:27 UTC
A commit references this bug:

Author: kevlo
Date: Sat Mar 18 13:58:25 UTC 2017
New revision: 315483
URL: https://svnweb.freebsd.org/changeset/base/315483

Log:
  MFC r315294:
  Fix unreachable code in wi_pci_resume().

  PR:	217784
  Submitted by:	Svyatoslav <razmyslov at viva64.com>
  Found by:	PVS-Studio

Changes:
_U  stable/11/
  stable/11/sys/dev/wi/if_wi_pci.c