[Mesa-dev] [PATCH] r600g/sb: Move variable dereference after null check.

Vadim Girlin vadimgirlin at gmail.com
Fri Sep 27 23:38:34 PDT 2013


On 09/28/2013 10:08 AM, Vinson Lee wrote:
> Fixes "Deference before null check" defect reported by Coverity.
>
> Signed-off-by: Vinson Lee <vlee at freedesktop.org>

Reviewed-by: Vadim Girlin <vadimgirlin at gmail.com>

> ---
>   src/gallium/drivers/r600/sb/sb_ra_init.cpp | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/gallium/drivers/r600/sb/sb_ra_init.cpp b/src/gallium/drivers/r600/sb/sb_ra_init.cpp
> index 0b332a9..e53aba5 100644
> --- a/src/gallium/drivers/r600/sb/sb_ra_init.cpp
> +++ b/src/gallium/drivers/r600/sb/sb_ra_init.cpp
> @@ -395,11 +395,12 @@ void ra_init::color_bs_constraint(ra_constraint* c) {
>
>   	for (vvec::iterator I = vv.begin(), E = vv.end(); I != E; ++I) {
>   		value *v = *I;
> -		sel_chan gpr = v->get_final_gpr();
>
>   		if (!v || v->is_dead())
>   			continue;
>
> +		sel_chan gpr = v->get_final_gpr();
> +
>   		val_set interf;
>
>   		if (v->chunk)
>



More information about the mesa-dev mailing list