lkml.org 
[lkml]   [2011]   [Sep]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v5 3.1.0-rc4-tip 3/26] Uprobes: register/unregister probes.
    On Tue, Sep 20, 2011 at 05:30:22PM +0530, Srikar Dronamraju wrote:
    > +int register_uprobe(struct inode *inode, loff_t offset,
    > + struct uprobe_consumer *consumer)
    > +{
    > + struct uprobe *uprobe;
    > + int ret = 0;
    > +
    > + inode = igrab(inode);
    > + if (!inode || !consumer || consumer->next)
    > + return -EINVAL;
    > +
    > + if (offset > inode->i_size)
    > + return -EINVAL;
    > +
    > + mutex_lock(&inode->i_mutex);
    > + uprobe = alloc_uprobe(inode, offset);
    > + if (!uprobe)
    > + return -ENOMEM;

    The error returns above don't iput(inode). And inode->i_mutex stays
    locked on this return.

    > +void unregister_uprobe(struct inode *inode, loff_t offset,
    > + struct uprobe_consumer *consumer)
    > +{
    > + struct uprobe *uprobe;
    > +
    > + inode = igrab(inode);
    > + if (!inode || !consumer)
    > + return;
    > +
    > + if (offset > inode->i_size)
    > + return;
    > +
    > + uprobe = find_uprobe(inode, offset);
    > + if (!uprobe)
    > + return;
    > +
    > + if (!del_consumer(uprobe, consumer)) {
    > + put_uprobe(uprobe);
    > + return;
    > + }

    More returns that do not iput(inode).

    Stefan


    \
     
     \ /
      Last update: 2011-09-20 19:59    [W:0.044 / U:31.544 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site