Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Wang Weidong and committed by
David S. Miller
965cdea8 b1aca94e

+7 -12
+7 -12
net/dccp/probe.c
··· 152 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 155 static __init int dccpprobe_init(void) 167 156 { 168 157 int ret = -ENOMEM; ··· 163 174 if (!proc_create(procname, S_IRUSR, init_net.proc_net, &dccpprobe_fops)) 164 175 goto err0; 165 176 166 - ret = setup_jprobe(); 177 + ret = register_jprobe(&dccp_send_probe); 178 + if (ret) { 179 + ret = request_module("dccp"); 180 + if (!ret) 181 + ret = register_jprobe(&dccp_send_probe); 182 + } 183 + 167 184 if (ret) 168 185 goto err1; 169 186