Re: + proc-always-do-release.patch added to -mm tree

From: Alexey Dobriyan
Date: Fri Jun 27 2008 - 12:57:45 EST


> proc-always-do-release.patch

Ouch, please fold following incremental patch into it.



Don't add ->release'less PDEs into openers list.

This fixes possible call to NULL if ->release is not needed for some reason.

Signed-off-by: Alexey Dobriyan <adobriyan@xxxxxxxxx>
---

fs/proc/generic.c | 3 +--
fs/proc/inode.c | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)

--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -797,8 +797,7 @@ continue_removing:
pdeo = list_first_entry(&de->pde_openers, struct pde_opener, lh);
list_del(&pdeo->lh);
spin_unlock(&de->pde_unload_lock);
- if (pdeo->release)
- pdeo->release(pdeo->inode, pdeo->file);
+ pdeo->release(pdeo->inode, pdeo->file);
kfree(pdeo);
spin_lock(&de->pde_unload_lock);
}
--- a/fs/proc/inode.c
+++ b/fs/proc/inode.c
@@ -348,7 +348,7 @@ static int proc_reg_open(struct inode *inode, struct file *file)
rv = open(inode, file);

spin_lock(&pde->pde_unload_lock);
- if (rv == 0) {
+ if (rv == 0 && release) {
/* To know what to release. */
pdeo->inode = inode;
pdeo->file = file;

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/