Re: [PATCH 1/2] drm/i915/selftests: fix smatch warning in igt_check_blocks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2021-07-02 at 11:46:41 +0100, Matthew Auld wrote:
> The block here can't be NULL, especially since we already dereferenced
> it earlier, so remove the redundant check.
> 
> igt_check_blocks() warn: variable dereferenced before check 'block' (see line 126)
> 
> Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> Signed-off-by: Matthew Auld <matthew.auld@xxxxxxxxx>
> ---
>  drivers/gpu/drm/i915/selftests/i915_buddy.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/selftests/i915_buddy.c b/drivers/gpu/drm/i915/selftests/i915_buddy.c
> index f0f5c4df8dbc..d61ec9c951bf 100644
> --- a/drivers/gpu/drm/i915/selftests/i915_buddy.c
> +++ b/drivers/gpu/drm/i915/selftests/i915_buddy.c
> @@ -166,10 +166,8 @@ static int igt_check_blocks(struct i915_buddy_mm *mm,
>  		igt_dump_block(mm, prev);
>  	}
>  
> -	if (block) {
> -		pr_err("bad block, dump:\n");
> -		igt_dump_block(mm, block);
> -	}
> +	pr_err("bad block, dump:\n");
> +	igt_dump_block(mm, block);
LGTM.

Reviewed-by: Ramalingam C <ramalingam.c@xxxxxxxxx>
>  
>  	return err;
>  }
> -- 
> 2.26.3
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx



[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux