From: Kris Van Hees Date: Thu, 17 Oct 2013 09:42:04 +0000 (-0400) Subject: dtrace: reject enabling is referencing module fails and do not count it X-Git-Tag: v4.1.12-111.0.20170907_2225~3^2~3^2~115 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=b2b7b7d1f8d0e84554fd9cdbecc60c02e4a8d5e3;p=users%2Fjedix%2Flinux-maple.git dtrace: reject enabling is referencing module fails and do not count it Signed-off-by: Kris Van Hees --- 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); \