diff --git a/fs/hmdfs/inode_local.c b/fs/hmdfs/inode_local.c index 06b0235db8c189e63c4cb73dbe8b9723501b1b9f..a6dff05efb0e376b154437aa9a836bb49f7c47eb 100644 --- a/fs/hmdfs/inode_local.c +++ b/fs/hmdfs/inode_local.c @@ -913,6 +913,10 @@ static int hmdfs_getattr_local(const struct path *path, struct kstat *stat, struct path lower_path; int ret; + if (path->dentry == NULL || hmdfs_d(path->dentry) == NULL) { + hmdfs_err("dentry is NULL"); + return -ENOENT; + } hmdfs_get_lower_path(path->dentry, &lower_path); ret = vfs_getattr(&lower_path, stat, request_mask, flags); stat->ino = d_inode(path->dentry)->i_ino;