[igt-dev] [PATCH i-g-t] lib/igt_kms: Fixed the usage of Dereferencing of null pointer

Kamil Konieczny kamil.konieczny at linux.intel.com
Wed Jan 18 19:57:13 UTC 2023


On 2023-01-18 at 20:27:57 +0530, Mohammed Thasleem wrote:
> Fixed the usage of Dereferencing of null pointer to avoid crash.
-------------------- ^
Please make it lowercase, s/D/d/

Correct it also in your Subject.

> 
> Signed-off-by: Mohammed Thasleem <mohammed.thasleem at intel.com>
> ---
>  lib/igt_kms.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index b4a98ae1..b3334b3a 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -1941,6 +1941,7 @@ kmstest_get_property(int drm_fd, uint32_t object_id, uint32_t object_type,
>  	int i;
>  
>  	proplist = drmModeObjectGetProperties(drm_fd, object_id, object_type);
> +	igt_require(proplist);
------- ^
imho just return false here, so

	if (!proplist)
		return false;

Regards,
Kamil

>  	for (i = 0; i < proplist->count_props; i++) {
>  		_prop = drmModeGetProperty(drm_fd, proplist->props[i]);
>  		if (!_prop)
> -- 
> 2.25.1
> 


More information about the igt-dev mailing list