Commit 66edde86 authored by Wang Weidong's avatar Wang Weidong Committed by Willy Tarreau

dccp: catch failed request_module call in dccp_probe init

commit 965cdea8 upstream.

Check the return value of request_module during dccp_probe initialisation,
bail out if that call fails.
Signed-off-by: default avatarGerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: default avatarWang Weidong <wangweidong1@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
parent 7ec21203
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment