提交 965cdea8 编写于 作者: W Wang Weidong 提交者: David S. Miller

dccp: catch failed request_module call in dccp_probe init

Check the return value of request_module during dccp_probe initialisation,
bail out if that call fails.
Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: NWang Weidong <wangweidong1@huawei.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 b1aca94e
......@@ -152,17 +152,6 @@ static const struct file_operations dccpprobe_fops = {
.llseek = noop_llseek,
};
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;
......@@ -174,7 +163,13 @@ static __init int dccpprobe_init(void)
if (!proc_create(procname, S_IRUSR, init_net.proc_net, &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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册