mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Maninder Singh <maninder1.s@samsung.com>
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" <v.narang@samsung.com>
Subject: [EDT] [PATCH] devpts/inode.c : Fix Possible dentry NULL dereference
Date: Thu, 21 May 2015 10:28:52 +0000 (GMT)	[thread overview]
Message-ID: <1817342376.533191432204130151.JavaMail.weblogic@ep2mlwas07b> (raw)

[-- 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¥

             reply	other threads:[~2015-05-21 10:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-21 10:28 Maninder Singh [this message]
2015-05-21 10:42 ` Richard Weinberger
2015-05-21 11:12 ` Al Viro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1817342376.533191432204130151.JavaMail.weblogic@ep2mlwas07b \
    --to=maninder1.s@samsung.com \
    --cc=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=fabf@skynet.be \
    --cc=linux-kernel@vger.kernel.org \
    --cc=v.narang@samsung.com \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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