From 19f659eb805dbaf9e056c2689b151ab7fed2f7a5 Mon Sep 17 00:00:00 2001
From: Tim Gardner <tim.gardner@canonical.com>
Date: Wed, 9 Nov 2011 11:51:50 -0700
Subject: [PATCH 2/2] CHROMIUM: Fix kref usage

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 |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/seccomp_filter.c b/kernel/seccomp_filter.c
index ac682cf..c551b9c 100644
--- a/kernel/seccomp_filter.c
+++ b/kernel/seccomp_filter.c
@@ -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. */
-- 
1.7.4.1

