[PATCH v2 2/2] kunit: avoid memory leak on device register error