From: Josh Triplett Date: Tue, 30 Jun 2015 21:58:27 +0000 (-0700) Subject: devpts: if initialization failed, don't crash when opening /dev/ptmx X-Git-Tag: omap-for-v4.2/fixes-rc1^2~53^2~33 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9ce71148b027e2bd27016139cae1c39401587695;p=pandora-kernel.git 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 Reported-by: Fengguang Wu Reviewed-by: Peter Hurley Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed