From: Alexey Dobriyan Signed-off-by: Alexey Dobriyan Signed-off-by: Andrew Morton --- fs/proc/inode.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff -puN fs/proc/inode.c~fix-rmmod-read-write-races-in-proc-entries-fix fs/proc/inode.c --- a/fs/proc/inode.c~fix-rmmod-read-write-races-in-proc-entries-fix +++ a/fs/proc/inode.c @@ -167,8 +167,9 @@ static loff_t proc_reg_llseek(struct fil llseek = pde->proc_fops->llseek; spin_unlock(&pde->pde_unload_lock); - if (llseek) - rv = llseek(file, offset, whence); + if (!llseek) + llseek = default_llseek; + rv = llseek(file, offset, whence); spin_lock(&pde->pde_unload_lock); pde->pde_users--; _