---
title: Cancel
framework: kernel
role: symbol
role_heading: Instance Method
path: kernel/osaction/3438205-cancel
---

# Cancel

Cancels the execution of the action's callbacks.

## Declaration

```occ
kern_return_t Cancel(OSActionCancelHandler handler);
```

## Parameters

- `handler`: A handler block for the system to call after any in-flight callbacks finish executing.

## Return Value

Return Value kIOReturnSuccess on success, or another value if an error occurs. See Error Codes.

## Discussion

Discussion After cancellation, you can only free the action object. You cannot reactivate it.

## See Also

### Ending the Action Early

- [Aborted](driverkit/osaction/aborted.md)
- [OSActionAbortedHandler](driverkit/osactionabortedhandler.md)
- [OSActionCancelHandler](driverkit/osactioncancelhandler.md)
