Skip to content

Commit

Permalink
Fix nil-pointer mistake
Browse files Browse the repository at this point in the history
  • Loading branch information
birksl committed May 30, 2024
1 parent 122d879 commit bc85b61
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/services/govmomi/pci/device.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func ConstructDeviceSpecs(pciDeviceSpecs []infrav1.PCIDeviceSpec) []types.BaseVi
}

func createBackingInfo(spec infrav1.PCIDeviceSpec) types.BaseVirtualDeviceBackingInfo {
if spec.VGPUProfile == "" {
if spec.DeviceID != nil && spec.VendorID != nil {
return &types.VirtualPCIPassthroughDynamicBackingInfo{
AllowedDevice: []types.VirtualPCIPassthroughAllowedDevice{
{
Expand All @@ -95,7 +95,7 @@ func createBackingInfo(spec infrav1.PCIDeviceSpec) types.BaseVirtualDeviceBackin
}

func constructKey(pciDeviceSpec infrav1.PCIDeviceSpec) string {
if pciDeviceSpec.VGPUProfile == "" {
if pciDeviceSpec.DeviceID != nil && pciDeviceSpec.VendorID != nil {
return fmt.Sprintf("%d-%d", *pciDeviceSpec.DeviceID, *pciDeviceSpec.VendorID)
}

Expand Down

0 comments on commit bc85b61

Please sign in to comment.