diff --git a/init/main.c b/init/main.c
index ec3a1463ac692a7ad15661ab65a52f30e50256df..1ecfd43ed4643461af60bb47f5d4f61aad9b12af 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 */