CHROMIUM: Fix kref usage
authorTim Gardner <tim.gardner@canonical.com>
Wed, 9 Nov 2011 18:51:50 +0000 (11:51 -0700)
committerLeann Ogasawara <leann.ogasawara@canonical.com>
Mon, 2 Apr 2012 20:13:30 +0000 (13:13 -0700)
BugLink: http://bugs.launchpad.net/bugs/887780

Also fixes some compile warnings.

Signed-off-by: Tim Gardner <tim.gardner@canonical.com>

kernel/seccomp_filter.c

index ac682cf..c551b9c 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <linux/capability.h>
 #include <linux/compat.h>
+#include <linux/module.h>
 #include <linux/err.h>
 #include <linux/errno.h>
 #include <linux/ftrace_event.h>
@@ -646,13 +647,12 @@ void put_seccomp_filters(struct seccomp_filters *orig)
 {
        if (!orig)
                return;
-       kref_put(orig, __put_seccomp_filters);
+       kref_put(&orig->usage, __put_seccomp_filters);
 }
 
 /* get_seccomp_filters - increments the reference count of @orig. */
 struct seccomp_filters *get_seccomp_filters(struct seccomp_filters *orig)
 {
-       int usage;
        if (!orig)
                return NULL;
        /* XXX: kref needs overflow prevention support. */