diff options
Diffstat (limited to 'include/kunit/test.h')
-rw-r--r-- | include/kunit/test.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/kunit/test.h b/include/kunit/test.h index 35b0aed9b739..24b40e5c160b 100644 --- a/include/kunit/test.h +++ b/include/kunit/test.h @@ -540,8 +540,9 @@ kunit_find_resource(struct kunit *test, void *match_data) { struct kunit_resource *res, *found = NULL; + unsigned long flags; - spin_lock(&test->lock); + spin_lock_irqsave(&test->lock, flags); list_for_each_entry_reverse(res, &test->resources, node) { if (match(test, res, (void *)match_data)) { @@ -551,7 +552,7 @@ kunit_find_resource(struct kunit *test, } } - spin_unlock(&test->lock); + spin_unlock_irqrestore(&test->lock, flags); return found; } |