lkml.org 
[lkml]   [2008]   [Jun]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    SubjectRe: + proc-always-do-release.patch added to -mm tree
    >      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@gmail.com>
    ---

    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;


    \
     
     \ /
      Last update: 2008-06-27 18:59    [W:0.030 / U:2.608 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site