lkml.org 
[lkml]   [2014]   [Aug]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] proc: potential ERR_PTR dereference on proc_fill_cache()
The d_hash_and_lookup() returns NULL or ERR_PTR on lookup
failure.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
---
fs/proc/base.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/proc/base.c b/fs/proc/base.c
index f50d4be..49bc09c 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -1673,7 +1673,7 @@ bool proc_fill_cache(struct file *file, struct dir_context *ctx,
ino_t ino;

child = d_hash_and_lookup(dir, &qname);
- if (!child) {
+ if (IS_ERR_OR_NULL(child)) {
child = d_alloc(dir, &qname);
if (!child)
goto end_instantiate;
--
1.7.1


\
 
 \ /
  Last update: 2014-08-11 05:01    [W:0.043 / U:0.644 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site