Josh Triplett 9ce71148b0 devpts: if initialization failed, don't crash when opening /dev/ptmx
If devpts failed to initialize, it would store an ERR_PTR in the global
devpts_mnt.  A subsequent open of /dev/ptmx would call devpts_new_index,
which would dereference devpts_mnt and crash.

Avoid storing invalid values in devpts_mnt; leave it NULL instead.  Make
both devpts_new_index and devpts_pty_new fail gracefully with ENODEV in
that case, which then becomes the return value to the userspace open call
on /dev/ptmx.

[akpm@linux-foundation.org: remove unneeded static]
Signed-off-by: Josh Triplett <josh@joshtriplett.org>
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Reviewed-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-06-30 19:44:58 -07:00
..
2015-06-30 19:44:57 -07:00
2015-05-10 22:18:28 -04:00
2015-06-25 17:00:42 -07:00
2015-06-27 09:47:46 -07:00
2015-06-23 17:38:39 -07:00
2015-05-10 22:18:26 -04:00
2015-04-21 16:16:02 -04:00
2015-06-25 17:00:42 -07:00
2015-04-11 22:29:40 -04:00
2015-05-10 22:18:26 -04:00
2015-05-21 15:19:15 +02:00
2015-06-02 09:22:34 -06:00
2015-04-17 09:04:07 -04:00
2015-05-11 08:13:13 -04:00
2015-04-17 09:04:12 -04:00
2015-05-31 13:23:08 +02:00