diff --git a/fs/hmdfs/hmdfs_device_view.h b/fs/hmdfs/hmdfs_device_view.h index a1f792d9eb0f68ad1ea5eaabf75a6b09f2f5178f..3b0f489d5db843d2042120c0e5d95f62caff2e9f 100644 --- a/fs/hmdfs/hmdfs_device_view.h +++ b/fs/hmdfs/hmdfs_device_view.h @@ -201,6 +201,14 @@ int hmdfs_convert_lookup_flags(unsigned int hmdfs_flags, unsigned int *vfs_flags); static inline void hmdfs_get_lower_path(struct dentry *dent, struct path *pname) { + if (!hmdfs_d(dent)) { + hmdfs_err("private data is NULL"); + return; + } + if (!hmdfs_d(dent)->lower_path) { + hmdfs_err("lower_path is NULL"); + return; + } spin_lock(&hmdfs_d(dent)->lock); pname->dentry = hmdfs_d(dent)->lower_path.dentry; pname->mnt = hmdfs_d(dent)->lower_path.mnt;