Skip to content

Commit

Permalink
(cherry-pick) Fix: correct issue pointed out by static analysis (#3044)…
Browse files Browse the repository at this point in the history
… (#3046)

* Fix: correct issue pointed out by static analysis (#3044)

### Description
Static analysis complained that although a destructor had been defined in class vfio_device, there was not a corresponding copy ctor nor assignment operator. The variable is treated as a Singleton in the application, so no copying occurs.  Implementing the constructor and assignment operator as deleted solves the issue.

### Collateral (docs, reports, design examples, case IDs):


- [ ] Document Update Required? (Specify FIM/AFU/Scripts)

### Tests added:


### Tests run:
CI

Signed-off-by: Tim Whisonant <tim.whisonant@intel.com>
  • Loading branch information
tswhison committed Nov 17, 2023
1 parent 7458404 commit d63ca2c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion binaries/opae.io/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ struct vfio_device {
close();
}

vfio_device(const vfio_device &) = delete;
vfio_device &operator=(const vfio_device &) = delete;

static vfio_device* open(const char *pci_addr)
{
opae_vfio *v = new opae_vfio();
Expand Down Expand Up @@ -243,6 +246,5 @@ struct vfio_device {
opae_vfio *v_;
vfio_device(opae_vfio *v)
: v_(v){}
vfio_device(const vfio_device &);
};

0 comments on commit d63ca2c

Please sign in to comment.