]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
Fix access violation in ggml_cuda_free_data if tensor->extra is NULL (#4554)
authorLoganDark <redacted>
Thu, 21 Dec 2023 09:59:27 +0000 (01:59 -0800)
committerGitHub <redacted>
Thu, 21 Dec 2023 09:59:27 +0000 (10:59 +0100)
ggml-cuda.cu

index 9f4b188cbb0d6f24b8c783fe2b134889f336a960..28d3787843800d9cbe2f0f090d44cd5c3a517a46 100644 (file)
@@ -9091,7 +9091,7 @@ void ggml_cuda_transform_tensor(void * data, struct ggml_tensor * tensor) {
 }
 
 void ggml_cuda_free_data(struct ggml_tensor * tensor) {
-    if (!tensor || (tensor->backend != GGML_BACKEND_GPU && tensor->backend != GGML_BACKEND_GPU_SPLIT) ) {
+    if (!tensor || !tensor->extra || (tensor->backend != GGML_BACKEND_GPU && tensor->backend != GGML_BACKEND_GPU_SPLIT) ) {
         return;
     }