From 016bed7e9e402f3dcb3dc181f46e00cd4d767643 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Marczewski?= Date: Wed, 9 Sep 2020 10:05:05 +0200 Subject: [PATCH] [LibOS] thread: add error handling for dentry_get_path() --- LibOS/shim/src/fs/proc/thread.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/LibOS/shim/src/fs/proc/thread.c b/LibOS/shim/src/fs/proc/thread.c index 32346ae6..6a41e5e1 100644 --- a/LibOS/shim/src/fs/proc/thread.c +++ b/LibOS/shim/src/fs/proc/thread.c @@ -118,8 +118,10 @@ static int find_thread_link(const char* name, struct shim_qstr* link, struct shi dent = next_dent; } - if (link) - dentry_get_path_into_qstr(dent, link); + if (link && !dentry_get_path_into_qstr(dent, link)) { + ret = -ENOMEM; + goto out; + } if (dentptr) { get_dentry(dent); @@ -361,8 +363,10 @@ static int find_thread_each_fd(const char* name, struct shim_qstr* link, dent = next_dent; } - if (link) - dentry_get_path_into_qstr(dent, link); + if (link && !dentry_get_path_into_qstr(dent, link)) { + ret = -ENOMEM; + goto out; + } if (dentptr) { get_dentry(dent);