From: LoganDark Date: Thu, 21 Dec 2023 09:59:27 +0000 (-0800) Subject: Fix access violation in ggml_cuda_free_data if tensor->extra is NULL (#4554) X-Git-Tag: upstream/0.0.4488~2823 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=1d7a1912cea2227f9a1a449758ed622c560542f9;p=pkg%2Fggml%2Fsources%2Fllama.cpp Fix access violation in ggml_cuda_free_data if tensor->extra is NULL (#4554) --- diff --git a/ggml-cuda.cu b/ggml-cuda.cu index 9f4b188c..28d37878 100644 --- a/ggml-cuda.cu +++ b/ggml-cuda.cu @@ -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; }