From 8f438f646cda4f0ce22037b2f5d5b1ea33bc40ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20=C5=9Alusarz?= Date: Tue, 15 Dec 2020 15:43:21 +0100 Subject: [PATCH] iris: remove redundant check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit list_del dereferences both next and prev, so if only one of them could be NULL we would get crashes already. Should fix "Dereference after null check" reported by Coverity. Code was added in: 64b73b770b7 ("iris: Fix bad external BO hash table and zombie list interactions") Signed-off-by: Marcin Ślusarz Reviewed-by: Timothy Arceri Reviewed-by: Marek Olšák Part-of: --- src/gallium/drivers/iris/iris_bufmgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/iris/iris_bufmgr.c b/src/gallium/drivers/iris/iris_bufmgr.c index 12c13f43733..46fdf655783 100644 --- a/src/gallium/drivers/iris/iris_bufmgr.c +++ b/src/gallium/drivers/iris/iris_bufmgr.c @@ -206,7 +206,7 @@ find_and_ref_external_bo(struct hash_table *ht, unsigned int key) * we hadn't yet closed it...and then reimported the same BO. If it * is, then remove it since it's now been resurrected. */ - if (bo->head.prev || bo->head.next) + if (bo->head.next) list_del(&bo->head); iris_bo_reference(bo);