From b2b7b7d1f8d0e84554fd9cdbecc60c02e4a8d5e3 Mon Sep 17 00:00:00 2001 From: Kris Van Hees Date: Thu, 17 Oct 2013 05:42:04 -0400 Subject: [PATCH] dtrace: reject enabling is referencing module fails and do not count it Signed-off-by: Kris Van Hees --- dtrace/include/dtrace/provider.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dtrace/include/dtrace/provider.h b/dtrace/include/dtrace/provider.h index 6bc7c6b559ae..c5a3a4f252d6 100644 --- a/dtrace/include/dtrace/provider.h +++ b/dtrace/include/dtrace/provider.h @@ -809,11 +809,12 @@ extern void dtrace_probe(dtrace_id_t, uintptr_t, uintptr_t, uintptr_t, { \ int rc = 0; \ \ - if (name##_refc++ == 0) { \ - if ((rc = try_module_get(THIS_MODULE)) == 0) \ - return 0; \ + if (name##_refc == 0) { \ + if (!try_module_get(THIS_MODULE)) \ + return -EAGAIN; \ } \ \ + name##_refc++; \ if ((rc = _##name##_enable(arg, id, parg)) != 0) { \ if (--name##_refc == 0) \ module_put(THIS_MODULE); \ -- 2.50.1