X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=src%2Fprobes%2Flttng-uprobes.c;h=edded1e960aee6a508020bb527b1912c62ce1c91;hb=c35f268c4169db55bd65c95472442cd4d00eb53f;hp=549fa6628364bb124f537dc13e9f9333dcee2bde;hpb=853f5b15987181812b9973d86607cb9d76c850b9;p=lttng-modules.git diff --git a/src/probes/lttng-uprobes.c b/src/probes/lttng-uprobes.c index 549fa662..edded1e9 100644 --- a/src/probes/lttng-uprobes.c +++ b/src/probes/lttng-uprobes.c @@ -10,6 +10,7 @@ */ #include +#include #include #include #include @@ -153,7 +154,7 @@ static struct inode *get_inode_from_fd(int fd) * Returns the file backing the given fd. Needs to be done inside an RCU * critical section. */ - file = lttng_lookup_fd_rcu(fd); + file = lttng_lookup_fdget_rcu(fd); if (file == NULL) { printk(KERN_WARNING "LTTng: Cannot access file backing the fd(%d)\n", fd); inode = NULL; @@ -164,8 +165,11 @@ static struct inode *get_inode_from_fd(int fd) inode = igrab(file->f_path.dentry->d_inode); if (inode == NULL) printk(KERN_WARNING "LTTng: Cannot grab a reference on the inode.\n"); + error: rcu_read_unlock(); + if (file) + fput(file); return inode; }