aboutsummaryrefslogtreecommitdiff
path: root/net/netfilter/nft_compat.c
diff options
context:
space:
mode:
authorAlex Shi <alex.shi@linaro.org>2015-03-30 11:22:08 +0800
committerAlex Shi <alex.shi@linaro.org>2015-03-30 11:22:08 +0800
commit877c2196bf43e410b8b1a66c7bbf7d5cb98a9f41 (patch)
treef74b6a59cd223c470830b3e4f3e1b6a4270abc1a /net/netfilter/nft_compat.c
parentb95b6a6ddfae1513893676e444f585a106513688 (diff)
parent2dad587ec1dddf02a00d3b54156337a6dc79a752 (diff)
Merge branch 'linux-linaro-lsk-v3.14' into linux-linaro-lsk-v3.14-androidlinux-linaro-lsk-v3.14-android
Conflicts: net/netfilter/xt_socket.c
Diffstat (limited to 'net/netfilter/nft_compat.c')
-rw-r--r--net/netfilter/nft_compat.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/net/netfilter/nft_compat.c b/net/netfilter/nft_compat.c
index ad979612238a..7350723aeb15 100644
--- a/net/netfilter/nft_compat.c
+++ b/net/netfilter/nft_compat.c
@@ -611,8 +611,12 @@ nft_match_select_ops(const struct nft_ctx *ctx,
struct xt_match *match = nft_match->ops.data;
if (strcmp(match->name, mt_name) == 0 &&
- match->revision == rev && match->family == family)
+ match->revision == rev && match->family == family) {
+ if (!try_module_get(match->me))
+ return ERR_PTR(-ENOENT);
+
return &nft_match->ops;
+ }
}
match = xt_request_find_match(family, mt_name, rev);
@@ -682,8 +686,12 @@ nft_target_select_ops(const struct nft_ctx *ctx,
struct xt_target *target = nft_target->ops.data;
if (strcmp(target->name, tg_name) == 0 &&
- target->revision == rev && target->family == family)
+ target->revision == rev && target->family == family) {
+ if (!try_module_get(target->me))
+ return ERR_PTR(-ENOENT);
+
return &nft_target->ops;
+ }
}
target = xt_request_find_target(family, tg_name, rev);