Skip to content

Commit

Permalink
Prevent duplicate address nubs (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
1Revenger1 authored Oct 12, 2024
1 parent ad59df5 commit 0dfaefe
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion VoodooSMBus/VoodooSMBusControllerDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,12 @@ IOReturn VoodooSMBusControllerDriver::createNubGated(UInt8 address, IOService *p
if (!nub) {
return kIOReturnBadArgument;
}


if (getDevice(deviceList, address) != nullptr) {
IOLogError("Device at 0x%x already exists!", address);
return kIOReturnPortExists;
}

auto *device_nub = OSTypeAlloc(VoodooSMBusDeviceNub);

if (device_nub == nullptr ||
Expand Down

0 comments on commit 0dfaefe

Please sign in to comment.