zink: Remove unnecessary null checks.

Fix defects reported by Coverity Scan.

Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking sa suggests that it may be null,
but it has already been dereferenced on all paths leading to the
check.
check_after_deref: Null-checking sb suggests that it may be null,
but it has already been dereferenced on all paths leading to the
check.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12298>
This commit is contained in:
Vinson Lee 2021-08-09 20:40:31 -07:00 committed by Marge Bot
parent e6d996f8ff
commit ac1ddfba35

View file

@ -332,7 +332,7 @@ equals_gfx_pipeline_state(const void *a, const void *b)
if (sa->front_face != sb->front_face)
return false;
if (!!sa->depth_stencil_alpha_state != !!sb->depth_stencil_alpha_state ||
(sa && sb && memcmp(sa->depth_stencil_alpha_state, sb->depth_stencil_alpha_state, sizeof(struct zink_depth_stencil_alpha_hw_state))))
memcmp(sa->depth_stencil_alpha_state, sb->depth_stencil_alpha_state, sizeof(struct zink_depth_stencil_alpha_hw_state)))
return false;
}
return !memcmp(sa->modules, sb->modules, sizeof(sa->modules)) &&