Bug 217748 - sys/dev/ixgbe/if_ix.c: PVS-Studio: Assignment to Variable without Use (CWE-563) (1)
Summary: sys/dev/ixgbe/if_ix.c: PVS-Studio: Assignment to Variable without Use (CWE-56...
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 (Nobody)
URL:
Keywords: IntelNetworking, patch
Depends on:
Blocks:
 
Reported: 2017-03-13 12:14 UTC by Svyatoslav
Modified: 2018-05-28 00:58 UTC (History)
1 user (show)

See Also:
sbruno: mfc-stable11?
sbruno: mfc-stable10?


Attachments
git patch (397 bytes, patch)
2017-03-13 12:14 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 12:14:12 UTC
Created attachment 180771 [details]
git patch

We have found and fixed a vulnerability 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: V519 The 'vf->flags' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 5992, 5994. if_ix.c 5994
Comment 1 commit-hook freebsd_committer freebsd_triage 2017-04-05 22:02:03 UTC
A commit references this bug:

Author: sbruno
Date: Wed Apr  5 22:01:49 UTC 2017
New revision: 316544
URL: https://svnweb.freebsd.org/changeset/base/316544

Log:
  Don't overrite vf->flags variable at the end of ixgbe(4) ixgbe_add_vf().

  Found by PVS-Studio Static code analyzer.

  PR:		217748
  Submitted by:	razmyslov@viva64.com
  MFC after:	1 week

Changes:
  head/sys/dev/ixgbe/if_ix.c
Comment 2 Sean Bruno freebsd_committer freebsd_triage 2018-05-28 00:58:57 UTC
verified that this is fixed in stable11.