summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJP Abgrall <jpa@google.com>2012-10-09 20:38:21 -0700
committerJianzheng Zhou <jianzheng.zhou@freescale.com>2013-09-26 09:44:10 +0800
commit34ed2574b5c3c1b74e40075768a7bfece7726aa6 (patch)
treef152008a4f1b65ea6e119a1e7646849d35cd403c
parent7c350c76f8c90b67d98f404007a2c310b50909ab (diff)
netfilter: xt_qtaguid: fix error exit that would keep a spinlock.
qtudev_open() could return with a uid_tag_data_tree_lock held when an kzalloc(..., GFP_ATOMIC) would fail. Very unlikely to get triggered AND survive the mayhem of running out of mem. Signed-off-by: JP Abgrall <jpa@google.com>
-rw-r--r--net/netfilter/xt_qtaguid.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/netfilter/xt_qtaguid.c b/net/netfilter/xt_qtaguid.c
index ea716b31e2af..7efbab9b4bed 100644
--- a/net/netfilter/xt_qtaguid.c
+++ b/net/netfilter/xt_qtaguid.c
@@ -2752,7 +2752,7 @@ static int qtudev_open(struct inode *inode, struct file *file)
utd_entry = get_uid_data(current_fsuid(), &utd_entry_found);
if (IS_ERR_OR_NULL(utd_entry)) {
res = PTR_ERR(utd_entry);
- goto err;
+ goto err_unlock;
}
/* Look for existing PID based proc_data */
@@ -2794,8 +2794,8 @@ err_unlock_free_utd:
rb_erase(&utd_entry->node, &uid_tag_data_tree);
kfree(utd_entry);
}
+err_unlock:
spin_unlock_bh(&uid_tag_data_tree_lock);
-err:
return res;
}