Skip to content

Commit

Permalink
Fix compile and pointer to null data
Browse files Browse the repository at this point in the history
  • Loading branch information
1Revenger1 committed Oct 18, 2024
1 parent 5be336b commit 5f8bf24
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions VoodooRMI/Functions/F17.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ int F17::rmi_f17_process_stick(struct rmi_f17_stick_data *stick) {
} else {
IOLogDebug("%s: Reporting dx: %d, dy: %d\n", __func__, stick->data.rel.x_delta, stick->data.rel.y_delta);

report.dx = (SInt32)((SInt64)stick->data.rel.x_delta;
report.dy = -(SInt32)((SInt64)stick->data.rel.y_delta;
report.dx = (SInt32)((SInt64)stick->data.rel.x_delta);
report.dy = -(SInt32)((SInt64)stick->data.rel.y_delta);
report.buttons = 0;

handleReport(&report);
Expand Down
4 changes: 3 additions & 1 deletion VoodooRMI/RMIBus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,16 @@ bool RMIBus::start(IOService *provider) {

void RMIBus::handleHostNotify(AbsoluteTime time, UInt8 *data, size_t size) {
UInt32 irqStatus;
UInt8 *dataPtr = nullptr;
if (controlFunction == nullptr) {
IOLogError("Interrupt - No F01");
return;
}

if (data) {
irqStatus = data[0];
dataPtr = &data[1];
size -= sizeof(UInt8);
} else {
IOReturn error = controlFunction->readIRQ(irqStatus);
if (error != kIOReturnSuccess){
Expand All @@ -129,7 +132,6 @@ void RMIBus::handleHostNotify(AbsoluteTime time, UInt8 *data, size_t size) {
return;
}

UInt8 *dataPtr = &data[1];
while(RMIFunction *func = OSDynamicCast(RMIFunction, iter->getNextObject())) {
if (func->hasAttnSig(irqStatus)) {
func->attention(time, &dataPtr, &size);
Expand Down

0 comments on commit 5f8bf24

Please sign in to comment.