[tty-next,4/6] devpts: Make devpts_kill_sb safe if fsi is NULL

Submitted by Eric W. Biederman on Sept. 14, 2016, 6:53 p.m.

Details

Message ID 20160914185338.15126-4-ebiederm@xmission.com
State New
Series "Minor devpts cleanups, fixes and enhancments"
Headers show

Commit Message

Eric W. Biederman Sept. 14, 2016, 6:53 p.m.
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
---
 fs/devpts/inode.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c
index a48b40b0bd1e..e058ec677207 100644
--- a/fs/devpts/inode.c
+++ b/fs/devpts/inode.c
@@ -458,7 +458,8 @@  static void devpts_kill_sb(struct super_block *sb)
 {
 	struct pts_fs_info *fsi = DEVPTS_SB(sb);
 
-	ida_destroy(&fsi->allocated_ptys);
+	if (fsi)
+		ida_destroy(&fsi->allocated_ptys);
 	kfree(fsi);
 	kill_litter_super(sb);
 }