aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorPontus Fuchs <pontus.fuchs@gmail.com>2012-11-19 11:44:51 -0800
committerZiyan <jaraidaniel@gmail.com>2016-03-11 15:57:12 +0100
commitbbde6fb45f0f545f0ccd4419654b532dd46e635e (patch)
tree993d6e560513f7ed71478412f491990cbbf9be97 /net
parent7093c576261753ba20675dd1b836575749dd40cf (diff)
downloadkernel_samsung_espresso10-bbde6fb45f0f545f0ccd4419654b532dd46e635e.zip
kernel_samsung_espresso10-bbde6fb45f0f545f0ccd4419654b532dd46e635e.tar.gz
kernel_samsung_espresso10-bbde6fb45f0f545f0ccd4419654b532dd46e635e.tar.bz2
netfilter: qtaguid: Don't BUG_ON if create_if_tag_stat fails
If create_if_tag_stat fails to allocate memory (GFP_ATOMIC) the following will happen: qtaguid: iface_stat: tag stat alloc failed ... kernel BUG at xt_qtaguid.c:1482! Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
Diffstat (limited to 'net')
-rw-r--r--net/netfilter/xt_qtaguid.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/netfilter/xt_qtaguid.c b/net/netfilter/xt_qtaguid.c
index c0c3c6d..01c7797 100644
--- a/net/netfilter/xt_qtaguid.c
+++ b/net/netfilter/xt_qtaguid.c
@@ -1451,6 +1451,8 @@ static void if_tag_stat_update(const char *ifname, uid_t uid,
* - No {0, uid_tag} stats and no {acc_tag, uid_tag} stats.
*/
new_tag_stat = create_if_tag_stat(iface_entry, uid_tag);
+ if (!new_tag_stat)
+ goto unlock;
uid_tag_counters = &new_tag_stat->counters;
} else {
uid_tag_counters = &tag_stat_entry->counters;
@@ -1459,6 +1461,8 @@ static void if_tag_stat_update(const char *ifname, uid_t uid,
if (acct_tag) {
/* Create the child {acct_tag, uid_tag} and hook up parent. */
new_tag_stat = create_if_tag_stat(iface_entry, tag);
+ if (!new_tag_stat)
+ goto unlock;
new_tag_stat->parent_counters = uid_tag_counters;
} else {
/*
@@ -1472,6 +1476,7 @@ static void if_tag_stat_update(const char *ifname, uid_t uid,
BUG_ON(!new_tag_stat);
}
tag_stat_update(new_tag_stat, direction, proto, bytes);
+unlock:
spin_unlock_bh(&iface_entry->tag_stat_list_lock);
}