mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [EDT] [PATCH] devpts/inode.c : Fix Possible dentry NULL dereference
@ 2015-05-21 10:28 Maninder Singh
  2015-05-21 10:42 ` Richard Weinberger
  2015-05-21 11:12 ` Al Viro
  0 siblings, 2 replies; 3+ messages in thread
From: Maninder Singh @ 2015-05-21 10:28 UTC (permalink / raw)
  To: akpm, dhowells, fabf, viro, linux-kernel, v.narang

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=windows-1252, Size: 1055 bytes --]


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 <maninder1.s@samsung.com>
Reviewed-by: Vaneet Narang <v.narang@samsung.com>
---
 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Ç+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-05-21 11:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-21 10:28 [EDT] [PATCH] devpts/inode.c : Fix Possible dentry NULL dereference Maninder Singh
2015-05-21 10:42 ` Richard Weinberger
2015-05-21 11:12 ` Al Viro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome