From c43fa6b3209b229ac7b31fa7ce49a556f1c4d7ad Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Wed, 21 Aug 2019 09:33:39 -0700 Subject: panfrost: Hoist bo != NULL check before dereference Signed-off-by: Alyssa Rosenzweig --- src/gallium/drivers/panfrost/pan_drm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/panfrost/pan_drm.c b/src/gallium/drivers/panfrost/pan_drm.c index 28a4287202b..8ee39c52d4a 100644 --- a/src/gallium/drivers/panfrost/pan_drm.c +++ b/src/gallium/drivers/panfrost/pan_drm.c @@ -154,12 +154,12 @@ panfrost_drm_create_bo(struct panfrost_screen *screen, size_t size, void panfrost_drm_release_bo(struct panfrost_screen *screen, struct panfrost_bo *bo, bool cacheable) { - struct drm_gem_close gem_close = { .handle = bo->gem_handle }; - int ret; - if (!bo) return; + struct drm_gem_close gem_close = { .handle = bo->gem_handle }; + int ret; + /* Rather than freeing the BO now, we'll cache the BO for later * allocations if we're allowed to */ -- cgit v1.2.3