diff options
author | Wang Weidong <wangweidong1@huawei.com> | 2013-12-17 21:24:33 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-12-19 19:25:50 -0500 |
commit | 965cdea825693c821d200e38fac9402cde6dce6a (patch) | |
tree | df435cb3a5a93046922c88d6de39c221c175a219 /net/dccp | |
parent | b1aca94efa566551e3ea5ed6ee4adc068ae86d1c (diff) |
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>
Diffstat (limited to 'net/dccp')
-rw-r--r-- | net/dccp/probe.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/net/dccp/probe.c b/net/dccp/probe.c index 4c6bdf97a657..595ddf0459db 100644 --- a/net/dccp/probe.c +++ b/net/dccp/probe.c | |||
@@ -152,17 +152,6 @@ static const struct file_operations dccpprobe_fops = { | |||
152 | .llseek = noop_llseek, | 152 | .llseek = noop_llseek, |
153 | }; | 153 | }; |
154 | 154 | ||
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 | |||
166 | static __init int dccpprobe_init(void) | 155 | static __init int dccpprobe_init(void) |
167 | { | 156 | { |
168 | int ret = -ENOMEM; | 157 | int ret = -ENOMEM; |
@@ -174,7 +163,13 @@ static __init int dccpprobe_init(void) | |||
174 | if (!proc_create(procname, S_IRUSR, init_net.proc_net, &dccpprobe_fops)) | 163 | if (!proc_create(procname, S_IRUSR, init_net.proc_net, &dccpprobe_fops)) |
175 | goto err0; | 164 | goto err0; |
176 | 165 | ||
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 | |||
178 | if (ret) | 173 | if (ret) |
179 | goto err1; | 174 | goto err1; |
180 | 175 | ||