From 0aca372ce8e8674dbdda1cc7ce3a6b684b7d118e Mon Sep 17 00:00:00 2001 From: jsteube Date: Wed, 15 Feb 2017 19:43:22 +0100 Subject: [PATCH] Hardware Monitor: In case NVML initialization failed, do not try to initialiaze NVAPI or XNVCTRL because they both depend on NVML --- docs/changes.txt | 1 + src/hwmon.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 3b8a7f3f5..e44ad20cf 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -66,6 +66,7 @@ - Events: Improved the maximum event message handling. event_log () will now also internally make sure that the message is properly terminated - Files: Do several file and folder checks on startup rather than when they are actually used to avoid related error after eventual intense operations - Helper: Added functions to check existence, type, read- and write-permissions and rewrite sources to use them instead of stat() +- Hardware Monitor: In case NVML initialization failed, do not try to initialiaze NVAPI or XNVCTRL because they both depend on NVML - Hardware Monitor: Fixed several memory leaks in case no hardware monitor sensor is found - Hardware Monitor: Fixed several memory leaks in case hash-file writing (caused by --remove) failed - Mask Increment: Fixed memory leak in case mask_append() fails diff --git a/src/hwmon.c b/src/hwmon.c index 094a60ade..8938304a1 100644 --- a/src/hwmon.c +++ b/src/hwmon.c @@ -3354,7 +3354,7 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx) } } - if (opencl_ctx->need_nvapi == true) + if ((opencl_ctx->need_nvapi == true) && (hwmon_ctx->hm_nvml)) // nvapi can't work alone, we need nvml, too { hwmon_ctx->hm_nvapi = (NVAPI_PTR *) hcmalloc (sizeof (NVAPI_PTR)); @@ -3366,7 +3366,7 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx) } } - if (opencl_ctx->need_xnvctrl == true) + if ((opencl_ctx->need_xnvctrl == true) && (hwmon_ctx->hm_nvml)) // xnvctrl can't work alone, we need nvml, too { hwmon_ctx->hm_xnvctrl = (XNVCTRL_PTR *) hcmalloc (sizeof (XNVCTRL_PTR));