From: Rob Clark Date: Thu, 2 Jun 2016 14:33:08 +0000 (-0400) Subject: freedreno: fix dereference before null check X-Git-Tag: upstream/17.1.0~9018 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ba452d43e0f5ee6ceec5da031f55904f8144472c;p=platform%2Fupstream%2Fmesa.git freedreno: fix dereference before null check ptr can actually never be null so just drop the check. CID 1362464 (#1 of 1): Dereference before null check (REVERSE_INULL) check_after_deref: Null-checking ptr suggests that it may be null, but it has already been dereferenced on all paths leading to the check. Signed-off-by: Rob Clark --- diff --git a/src/gallium/drivers/freedreno/freedreno_query_hw.h b/src/gallium/drivers/freedreno/freedreno_query_hw.h index 8a5d114..095140e 100644 --- a/src/gallium/drivers/freedreno/freedreno_query_hw.h +++ b/src/gallium/drivers/freedreno/freedreno_query_hw.h @@ -163,8 +163,7 @@ fd_hw_sample_reference(struct fd_context *ctx, if (pipe_reference(&(*ptr)->reference, &samp->reference)) __fd_hw_sample_destroy(ctx, old_samp); - if (ptr) - *ptr = samp; + *ptr = samp; } #endif /* FREEDRENO_QUERY_HW_H_ */