Skip to content

Commit

Permalink
Fix access violation in ggml_cuda_free_data if tensor->extra is NULL (g…
Browse files Browse the repository at this point in the history
  • Loading branch information
LoganDark authored Dec 21, 2023
1 parent 799fc22 commit 1d7a191
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ggml-cuda.cu
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 1d7a191

Please sign in to comment.