summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Horman <nhorman@tuxdriver.com>2010-01-15 01:40:55 -0800
committerGreg Kroah-Hartman <gregkh@suse.de>2010-05-12 14:57:11 -0700
commit3b1aa6380f1991d756e4bc0902f6136aaa46e1c3 (patch)
treee871bc2bf94dd1daf752b6bcb17cd0a054b580cb
parent8b0744c9cb38e6beb06ec17fc78e372e3b05e067 (diff)
dccp_probe: Fix module load dependencies between dccp and dccp_probe
commit 38ff3e6bb987ec583268da8eb22628293095d43b upstream. This was just recently reported to me. When built as modules, the dccp_probe module has a silent dependency on the dccp module. This stems from the fact that the module_init routine of dccp_probe registers a jprobe on the dccp_sendmsg symbol. Since the symbol is only referenced as a text string (the .symbol_name field in the jprobe struct) rather than the address of the symbol itself, depmod never picks this dependency up, and so if you load the dccp_probe module without the dccp module loaded, the register_jprobe call fails with an -EINVAL, and the whole module load fails. The fix is pretty easy, we can just wrap the register_jprobe call in a try_then_request_module call, which forces the dependency to get satisfied prior to the probe registration. Signed-off-by: Neil Horman <nhorman@tuxdriver.com> Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net> Cc: maximilian attems <max@stro.at> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--net/dccp/probe.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/dccp/probe.c b/net/dccp/probe.c
index 37731da41481..48759983b2db 100644
--- a/net/dccp/probe.c
+++ b/net/dccp/probe.c
@@ -164,7 +164,8 @@ static __init int dccpprobe_init(void)
if (!proc_net_fops_create(&init_net, procname, S_IRUSR, &dccpprobe_fops))
goto err0;
- ret = register_jprobe(&dccp_send_probe);
+ ret = try_then_request_module((register_jprobe(&dccp_send_probe) == 0),
+ "dccp");
if (ret)
goto err1;