From patchwork Wed Sep 14 18:53:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Eric W. Biederman" X-Patchwork-Id: 9332297 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CB8A9607FD for ; Wed, 14 Sep 2016 19:08:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B8BB129F99 for ; Wed, 14 Sep 2016 19:08:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AD9212A256; Wed, 14 Sep 2016 19:08:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6D94929F99 for ; Wed, 14 Sep 2016 19:08:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1764274AbcINTHx (ORCPT ); Wed, 14 Sep 2016 15:07:53 -0400 Received: from out03.mta.xmission.com ([166.70.13.233]:54694 "EHLO out03.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1764170AbcINTHt (ORCPT ); Wed, 14 Sep 2016 15:07:49 -0400 Received: from in01.mta.xmission.com ([166.70.13.51]) by out03.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1bkFX5-00048V-N3; Wed, 14 Sep 2016 13:07:43 -0600 Received: from 97-119-97-64.omah.qwest.net ([97.119.97.64] helo=x220.int.ebiederm.org) by in01.mta.xmission.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1bkFX3-0000r5-Im; Wed, 14 Sep 2016 13:07:43 -0600 From: "Eric W. Biederman" To: Greg Kroah-Hartman , Jiri Slaby Cc: "H. Peter Anvin" , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Linux Containers , "Eric W. Biederman" Date: Wed, 14 Sep 2016 13:53:36 -0500 Message-Id: <20160914185338.15126-4-ebiederm@xmission.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20160914185338.15126-1-ebiederm@xmission.com> References: <87sht25n73.fsf@x220.int.ebiederm.org> <20160914185338.15126-1-ebiederm@xmission.com> X-XM-SPF: eid=1bkFX3-0000r5-Im; ; ; mid=<20160914185338.15126-4-ebiederm@xmission.com>; ; ; hst=in01.mta.xmission.com; ; ; ip=97.119.97.64; ; ; frm=ebiederm@xmission.com; ; ; spf=neutral X-XM-AID: U2FsdGVkX180CS8DAMQDTAlEj11EMFL2/uL20NNubC8= X-SA-Exim-Connect-IP: 97.119.97.64 X-SA-Exim-Mail-From: ebiederm@xmission.com Subject: [PATCH tty-next 4/6] devpts: Make devpts_kill_sb safe if fsi is NULL X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: "Eric W. Biederman" --- fs/devpts/inode.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); }