Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 300b994b authored by Alexey Dobriyan's avatar Alexey Dobriyan
Browse files

proc: fix return value of proc_reg_open() in "too late" case



If ->open() wasn't called, returning 0 is misleading and, theoretically,
oopsable:
1) remove_proc_entry clears ->proc_fops, drops lock,
2) ->open "succeeds",
3) ->release oopses, because it assumes ->open was called (single_release()).

Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
parent 3fa8749e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -342,7 +342,7 @@ static int proc_reg_open(struct inode *inode, struct file *file)
	if (!pde->proc_fops) {
		spin_unlock(&pde->pde_unload_lock);
		kfree(pdeo);
		return rv;
		return -EINVAL;
	}
	pde->pde_users++;
	open = pde->proc_fops->open;