mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
procfs: return ENOENT on opening a being-removed proc entry
Change the return value to ENOENT. This return value is then returned when opening the proc entry that have been removed. For example, open("/proc/bus/pci/XX/YY") when the corresponding device is being hot-removed. Signed-off-by: Daisuke Ogino <ogino.daisuke@jp.fujitsu.com> Cc: Jesse Barnes <jbarnes@virtuousgeek.org> Acked-by: Alexey Dobriyan <adobriyan@gmail.com> Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
5296f6d315
commit
d2857e79a2
1 changed files with 1 additions and 1 deletions
|
@ -319,7 +319,7 @@ static int proc_reg_open(struct inode *inode, struct file *file)
|
||||||
if (!pde->proc_fops) {
|
if (!pde->proc_fops) {
|
||||||
spin_unlock(&pde->pde_unload_lock);
|
spin_unlock(&pde->pde_unload_lock);
|
||||||
kfree(pdeo);
|
kfree(pdeo);
|
||||||
return -EINVAL;
|
return -ENOENT;
|
||||||
}
|
}
|
||||||
pde->pde_users++;
|
pde->pde_users++;
|
||||||
open = pde->proc_fops->open;
|
open = pde->proc_fops->open;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue