Skip to content

Commit

Permalink
Fix: correct issue pointed out by static analysis (#3044)
Browse files Browse the repository at this point in the history
### 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 be8ff84 commit ee42506
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions binaries/opae.io/main.h
Expand Up @@ -119,6 +119,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

0 comments on commit ee42506

Please sign in to comment.