Skip to content

Commit

Permalink
dccp: catch failed request_module call in dccp_probe init
Browse files Browse the repository at this point in the history
Check the return value of request_module during dccp_probe initialisation,
bail out if that call fails.

Signed-off-by: Gerrit Renker <[email protected]>
Signed-off-by: Wang Weidong <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Wang Weidong authored and davem330 committed Dec 20, 2013
1 parent b1aca94 commit 965cdea
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions net/dccp/probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand Down

0 comments on commit 965cdea

Please sign in to comment.