]> git.baikalelectronics.ru Git - kernel.git/commit
early init: fix error handling when opening /dev/console
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 17 Dec 2019 21:10:11 +0000 (13:10 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 17 Dec 2019 21:10:11 +0000 (13:10 -0800)
commit83ce61373770dbd09115aa5f8d3c1ae72787a6e0
tree6bc66d13f1815e181d3fac34e13b524a769940e0
parent0f3080f00ec4e1d6f79bbb604ea7dd5ad51283f3
early init: fix error handling when opening /dev/console

The comment says "this should never fail", but it definitely can fail
when you have odd initial boot filesystems, or kernel configurations.

So get the error handling right: filp_open() returns an error pointer.

Reported-by: Jesse Barnes <jsbarnes@google.com>
Reported-by: youling 257 <youling257@gmail.com>
Fixes: 1978e23931f1 ("fs: remove ksys_dup()")
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
init/main.c