diff --git a/fs/d_path.c b/fs/d_path.c index c25309006d5d..cad2f33ba92a 100644 --- a/fs/d_path.c +++ b/fs/d_path.c @@ -240,6 +240,11 @@ static void get_fs_root_rcu(struct fs_struct *fs, struct path *root) { unsigned seq; + if (!fs) { + *root = (struct path){}; + return; + } + do { seq = read_seqbegin(&fs->seq); *root = fs->root;