From: Erik Faye-Lund Date: Wed, 27 Nov 2019 16:17:08 +0000 (+0100) Subject: zink: avoid NULL-deref X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bda64440e45233d0bfd51b9c1596ae3a1788c3fd;p=mesa.git zink: avoid NULL-deref zink_render_pass_reference will dereference the memory 'dst' points at, which can't really go well. All we want to do here is to increase the reference-count, so let's use a different helper for that instead. CoverityID: 1455200 Reviewed-by: Dave Airlie --- diff --git a/src/gallium/drivers/zink/zink_program.c b/src/gallium/drivers/zink/zink_program.c index 92a75489cf5..95b47a69d93 100644 --- a/src/gallium/drivers/zink/zink_program.c +++ b/src/gallium/drivers/zink/zink_program.c @@ -210,9 +210,8 @@ reference_render_pass(struct zink_screen *screen, struct set_entry *entry = _mesa_set_search(prog->render_passes, render_pass); if (!entry) { - struct zink_render_pass *tmp = NULL; entry = _mesa_set_add(prog->render_passes, render_pass); - zink_render_pass_reference(screen, &tmp, render_pass); + pipe_reference(NULL, &render_pass->reference); } }