summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWang Weidong <wangweidong1@huawei.com>2013-12-17 19:24:33 -0700
committerWilly Tarreau <w@1wt.eu>2015-09-18 13:52:19 +0200
commit66edde86393c49d5a1897d209739ebf2066b48df (patch)
treec5dcc870a295f088c6ac6df8594ee14913035219
parent7ec212036c1e1400dace9b1aa64543c91f854705 (diff)
downloadlwn-66edde86393c49d5a1897d209739ebf2066b48df.tar.gz
lwn-66edde86393c49d5a1897d209739ebf2066b48df.zip
dccp: catch failed request_module call in dccp_probe init
commit 965cdea825693c821d200e38fac9402cde6dce6a upstream. Check the return value of request_module during dccp_probe initialisation, bail out if that call fails. Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk> Signed-off-by: Wang Weidong <wangweidong1@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Willy Tarreau <w@1wt.eu>
-rw-r--r--net/dccp/probe.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/net/dccp/probe.c b/net/dccp/probe.c
index 89f25cb95603..161081084844 100644
--- a/net/dccp/probe.c
+++ b/net/dccp/probe.c
@@ -151,17 +151,6 @@ static const struct file_operations dccpprobe_fops = {
.read = dccpprobe_read,
};
-static __init int setup_jprobe(void)
-{
- int ret = register_jprobe(&dccp_send_probe);
-
- if (ret) {
- request_module("dccp");
- ret = register_jprobe(&dccp_send_probe);
- }
- return ret;
-}
-
static __init int dccpprobe_init(void)
{
int ret = -ENOMEM;
@@ -175,7 +164,13 @@ static __init int dccpprobe_init(void)
if (!proc_net_fops_create(&init_net, procname, S_IRUSR, &dccpprobe_fops))
goto err0;
- ret = setup_jprobe();
+ ret = register_jprobe(&dccp_send_probe);
+ if (ret) {
+ ret = request_module("dccp");
+ if (!ret)
+ ret = register_jprobe(&dccp_send_probe);
+ }
+
if (ret)
goto err1;