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);