Skip to content

Commit 1d7a191

Browse files
authored
Fix access violation in ggml_cuda_free_data if tensor->extra is NULL (#4554)
1 parent 799fc22 commit 1d7a191

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ggml-cuda.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9091,7 +9091,7 @@ void ggml_cuda_transform_tensor(void * data, struct ggml_tensor * tensor) {
90919091
}
90929092

90939093
void ggml_cuda_free_data(struct ggml_tensor * tensor) {
9094-
if (!tensor || (tensor->backend != GGML_BACKEND_GPU && tensor->backend != GGML_BACKEND_GPU_SPLIT) ) {
9094+
if (!tensor || !tensor->extra || (tensor->backend != GGML_BACKEND_GPU && tensor->backend != GGML_BACKEND_GPU_SPLIT) ) {
90959095
return;
90969096
}
90979097

0 commit comments

Comments
 (0)