Skip to content
Snippets Groups Projects
Commit 083974eb authored by Dan Carpenter's avatar Dan Carpenter Committed by Shuah Khan
Browse files

kunit: device: Fix a NULL vs IS_ERR() check in init()


The root_device_register() function does not return NULL, it returns
error pointers.  Fix the check to match.

Fixes: d03c720e ("kunit: Add APIs for managing devices")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: default avatarRae Moar <rmoar@google.com>
Reviewed-by: default avatarDavid Gow <davidgow@google.com>
Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
parent ed1a72fb
No related branches found
No related tags found
No related merge requests found
......@@ -45,8 +45,8 @@ int kunit_bus_init(void)
int error;
kunit_bus_device = root_device_register("kunit");
if (!kunit_bus_device)
return -ENOMEM;
if (IS_ERR(kunit_bus_device))
return PTR_ERR(kunit_bus_device);
error = bus_register(&kunit_bus_type);
if (error)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment