diff --git a/vfs_cache.c b/vfs_cache.c index 429976cf1..c36849698 100644 --- a/vfs_cache.c +++ b/vfs_cache.c @@ -663,6 +663,9 @@ struct ksmbd_file *ksmbd_open_fd(struct ksmbd_work *work, struct file *filp) void ksmbd_update_fstate(struct ksmbd_file_table *ft, struct ksmbd_file *fp, unsigned int state) { + if (!fp) + return; + write_lock(&ft->lock); fp->f_state = state; write_unlock(&ft->lock);