kunit: run test suites only after module initialization completes
[platform/kernel/linux-rpi.git] / lib / idr.c
index 13f2758..da36054 100644 (file)
--- a/lib/idr.c
+++ b/lib/idr.c
@@ -508,7 +508,7 @@ void ida_free(struct ida *ida, unsigned int id)
                        goto delete;
                xas_store(&xas, xa_mk_value(v));
        } else {
-               if (!test_bit(bit, bitmap->bitmap))
+               if (!bitmap || !test_bit(bit, bitmap->bitmap))
                        goto err;
                __clear_bit(bit, bitmap->bitmap);
                xas_set_mark(&xas, XA_FREE_MARK);