kernel: add cleanup to data types
Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
parent
0f7a2e46cc
commit
69d2fed697
4 changed files with 13 additions and 2 deletions
|
|
@ -18,3 +18,9 @@ void spinlock_release(spinlock_t *lock)
|
|||
{
|
||||
atomic_cmpxchg(lock, 1, 0);
|
||||
}
|
||||
|
||||
void cleanup_spinlock(spinlock_t **lock_ptr)
|
||||
{
|
||||
if (lock_ptr && *lock_ptr)
|
||||
spinlock_release(*lock_ptr);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue