From: Alyssa Rosenzweig Date: Tue, 21 Apr 2020 22:23:00 +0000 (-0400) Subject: panfrost: Fix crashes with small BOs X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=133c1aba051f838a7651c966bdedc1e972d3e029;p=mesa.git panfrost: Fix crashes with small BOs Affects Bifrost. Signed-off-by: Alyssa Rosenzweig Part-of: --- diff --git a/src/panfrost/encoder/pan_bo.c b/src/panfrost/encoder/pan_bo.c index aca4f8f3848..9e5ea7ed21e 100644 --- a/src/panfrost/encoder/pan_bo.c +++ b/src/panfrost/encoder/pan_bo.c @@ -270,7 +270,7 @@ panfrost_bo_cache_put(struct panfrost_bo *bo) return false; pthread_mutex_lock(&dev->bo_cache.lock); - struct list_head *bucket = pan_bucket(dev, bo->size); + struct list_head *bucket = pan_bucket(dev, MAX2(bo->size, 4096)); struct drm_panfrost_madvise madv; struct timespec time;