Fix access violation in ggml_cuda_free_data if tensor->extra is NULL

This commit is contained in:
LoganDark 2023-12-20 14:32:38 -08:00
parent 799fc22689
commit 065d56c569
No known key found for this signature in database
GPG key ID: B8C37CEDE1AC60EA

View 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;
}