Dan Carpenter
unread,Jan 10, 2024, 1:55:20 PMJan 10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to davi...@google.com, Brendan Higgins, Shuah Khan, Matti Vaittinen, Maxime Ripard, Greg Kroah-Hartman, linux-k...@vger.kernel.org, kuni...@googlegroups.com, linux-...@vger.kernel.org, kernel-...@vger.kernel.org
The root_device_register() function does not return NULL, it returns
error pointers. Fix the check to match.
Fixes: d03c720e03bd ("kunit: Add APIs for managing devices")
Signed-off-by: Dan Carpenter <
dan.ca...@linaro.org>
---
lib/kunit/device.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/kunit/device.c b/lib/kunit/device.c
index f5371287b375..074c6dd2e36a 100644
--- a/lib/kunit/device.c
+++ b/lib/kunit/device.c
@@ -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)
--
2.43.0