Skip to content

Commit 59a3bc5

Browse files
committed
clear error from the very beginning just in case
1 parent 803d754 commit 59a3bc5

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

CPUFriend/kern_cpuf.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ void CPUFriendPlugin::myConfigResourceCallback(uint32_t requestTag, kern_return_
9797
} else {
9898
SYSLOG("myConfigResourceCallback", "failed to feed cpu data (%u, %d)", sz, data != nullptr);
9999
}
100-
101100
callbackCpuf->orgConfigLoadCallback(requestTag, result, resourceData, resourceDataLength, context);
102101
} else {
103102
SYSLOG("myConfigResourceCallback", "config callback arrived at nowhere");
@@ -109,7 +108,8 @@ void CPUFriendPlugin::processKext(KernelPatcher &patcher, size_t index, mach_vm_
109108
for (size_t i = 0; i < kextListSize; i++) {
110109
if (kextList[i].loadIndex == index) {
111110
DBGLOG("processKext", "current kext is %s progressState %d", kextList[i].id, progressState);
112-
111+
// clear error from the very beginning just in case
112+
patcher.clearError();
113113
if (!strcmp(kextList[i].id, idList[0])) {
114114
auto callback = patcher.solveSymbol(index, symbolList[0]);
115115
if (callback) {
@@ -122,7 +122,6 @@ void CPUFriendPlugin::processKext(KernelPatcher &patcher, size_t index, mach_vm_
122122
} else {
123123
SYSLOG("processKext", "failed to find %s", symbolList[0]);
124124
}
125-
126125
progressState |= cpufessingState::CallbackRouted;
127126
}
128127

0 commit comments

Comments
 (0)