early init: fix error handling when opening /dev/console
Changes
1 files changed · +1 −1
| File | Status | Add | Del | Content |
|---|---|---|---|---|
| init/main.c | modified | +1 | −1 | View file |
init/main.c
View filediff --git a/init/main.c b/init/main.c
index ec3a146..1ecfd43 100644
--- a/init/main.c
+++ b/init/main.c
@@ -1163,7 +1163,7 @@ void console_on_rootfs(void)
/* Open /dev/console in kernelspace, this should never fail */
file = filp_open("/dev/console", O_RDWR, 0);
- if (!file)
+ if (IS_ERR(file))
goto err_out;
/* create stdin/stdout/stderr, this should never fail */