Skip to content

Commit 965cdea

Browse files
Wang Weidongdavem330
authored andcommitted
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: Gerrit Renker <gerrit@erg.abdn.ac.uk> Signed-off-by: Wang Weidong <wangweidong1@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent b1aca94 commit 965cdea

1 file changed

Lines changed: 7 additions & 12 deletions

File tree

‎net/dccp/probe.c‎

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -152,17 +152,6 @@ static const struct file_operations dccpprobe_fops = {
152152
.llseek = noop_llseek,
153153
};
154154

155-
static __init int setup_jprobe(void)
156-
{
157-
int ret = register_jprobe(&dccp_send_probe);
158-
159-
if (ret) {
160-
request_module("dccp");
161-
ret = register_jprobe(&dccp_send_probe);
162-
}
163-
return ret;
164-
}
165-
166155
static __init int dccpprobe_init(void)
167156
{
168157
int ret = -ENOMEM;
@@ -174,7 +163,13 @@ static __init int dccpprobe_init(void)
174163
if (!proc_create(procname, S_IRUSR, init_net.proc_net, &dccpprobe_fops))
175164
goto err0;
176165

177-
ret = setup_jprobe();
166+
ret = register_jprobe(&dccp_send_probe);
167+
if (ret) {
168+
ret = request_module("dccp");
169+
if (!ret)
170+
ret = register_jprobe(&dccp_send_probe);
171+
}
172+
178173
if (ret)
179174
goto err1;
180175

0 commit comments

Comments
 (0)