Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753947AbbEUK25 (ORCPT ); Thu, 21 May 2015 06:28:57 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:53856 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751750AbbEUK2x (ORCPT ); Thu, 21 May 2015 06:28:53 -0400 X-AuditID: cbfee68f-f793b6d000005f66-83-555db364b8f1 Date: Thu, 21 May 2015 10:28:52 +0000 (GMT) From: Maninder Singh Subject: [EDT] [PATCH] devpts/inode.c : Fix Possible dentry NULL dereference To: akpm@linux-foundation.org, dhowells@redhat.com, fabf@skynet.be, viro@zeniv.linux.org.uk, linux-kernel@vger.kernel.org, "v.narang@samsung.com" Reply-to: maninder1.s@samsung.com MIME-version: 1.0 X-MTR: 20150521100537846@maninder1.s Msgkey: 20150521100537846@maninder1.s X-EPLocale: en_US.windows-1252 X-Priority: 3 X-EPWebmail-Msg-Type: personal X-EPWebmail-Reply-Demand: 0 X-EPApproval-Locale: X-EPHeader: ML X-MLAttribute: X-RootMTR: 20150521100537846@maninder1.s X-ParentMTR: X-ArchiveUser: X-CPGSPASS: N X-ConfirmMail: N,general Content-type: text/plain; charset=windows-1252 MIME-version: 1.0 Message-id: <1817342376.533191432204130151.JavaMail.weblogic@ep2mlwas07b> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrGIsWRmVeSWpSXmKPExsWyRsSkSjdlc2yowex+cYvLu+awOTB6fN4k F8AYxWWTkpqTWZZapG+XwJXxu2sea8EFzoqnt98xNjCu4exi5OQQElCTWLT3MRuILSFgInHv /3V2CFtM4sK99UBxLqCapYwSDW2f2GGK9lzfwAyRmMMosexzCxNIgkVAVaLv6S2wSWwC+hJn 965jBrGFBfwk7v3bxATSICJwmlFiZ9cydojVihLrbzxhBLF5BQQlTs58wgKxQUVi9ZEP7BBx VYm3D6cxQsTlJJZMvcwEYfNKzGh/ygITn/Z1DTOELS1xftYGRpgX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V1S8cQLanxMnzChMYZWYhycxC0j0LSTeymgWMLKsYRVML kguKk9IrTPSKE3OLS/PS9ZLzczcxghPOsyU7GBsuWB9iFOBgVOLh5VCPDRViTSwrrsw9xCjB wawkwtu4GijEm5JYWZValB9fVJqTWnyI0RQYUxOZpUST84HJMK8k3tDYxNzU2NTCwNDc3ExJ nPf/udwQIYH0xJLU7NTUgtQimD4mDk6pBsaXnwzvzFQ64bZ12vGbLU0LymZOmntSJGTKx1PF S2wixApVgmRlZjB39byf4Wzw3YiTjcuP1c58b51y+LIZDxd8P3i27GdVjl1hhbTLBKef7U1H ve5pfXwQd+Wr+LFV+irXJzE6PJfpeBCuLatwXuJg/nOdq7MiuFyaeyqWVYhyud6btDW83k2J pTgj0VCLuag4EQD1tAtFTgMAAA== DLP-Filter: Pass X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by nfs id t4LAT22k018366 Content-Length: 1055 Lines: 36 EP-F6AA0618C49C4AEDA73BFF1B39950BAB Hi, Subject: [PATCH 1/1] devpts/inode.c : Fix Possible dentry NULL dereference Issue reported by static tool Analyzer (Prevent). d_find_alias can return NULL to deentry, Thus we need NULL check before calling d_delete(dentry) Signed-off-by: Maninder Singh Reviewed-by: Vaneet Narang --- fs/devpts/inode.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c index add5663..0350ac2 100644 --- a/fs/devpts/inode.c +++ b/fs/devpts/inode.c @@ -663,7 +663,8 @@ void devpts_pty_kill(struct inode *inode) dentry = d_find_alias(inode); drop_nlink(inode); - d_delete(dentry); + if (dentry) + d_delete(dentry); dput(dentry); /* d_alloc_name() in devpts_pty_new() */ dput(dentry); /* d_find_alias above */ -- 1.7.1 Thanks , Maninder Singh????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?