[PATCH i-g-t v3 1/2] lib/igt_panel: Validate vendor name in igt_is_panel_blocked

Kamil Konieczny kamil.konieczny at linux.intel.com
Thu Jun 12 10:21:28 UTC 2025


Hi Santhosh,
On 2025-06-12 at 10:43:25 +0530, Santhosh Reddy Guddati wrote:
> Avoids false positives by returning false early when the vendor name is
> NULL, empty, or a single whitespace character.
> 
> V2: Add Fixes tag (Suraj)
> 
> V3: Split the commit and indentation (Kamil)

You didn't desciribe code style fix here, is it needed?

> 
> Fixes: ec444a83c8ff ("lib/igt_panel: Skip hdcp tests on unsupported panels")
> Signed-off-by: Santhosh Reddy Guddati <santhosh.reddy.guddati at intel.com>
> ---
>  lib/igt_panel.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/igt_panel.c b/lib/igt_panel.c
> index c89bf9123..a5aa83e8b 100644
> --- a/lib/igt_panel.c
> +++ b/lib/igt_panel.c
> @@ -20,11 +20,15 @@
>   * true if the vendor name is found in the blocklist, false otherwise.
>   */
>  bool igt_is_panel_blocked(const char *vendor_name,
> -			    const char *const blocklist[],
> -			    size_t blocklist_size)
> +			  const char *const blocklist[],
> +			  size_t blocklist_size)

Try to avoid mixing code style fixing with real bug fixing.
Here it looks ok as it is located in one hunk.

>  {
>  	int i;
>  
> +	if (!vendor_name || vendor_name[0] == '\0' ||
> +	    (vendor_name[0] == ' ' && vendor_name[1] == '\0'))
> +		return false;
> +

LGTM
Reviewed-by: Kamil Konieczny <kamil.konieczny at linux.intel.com>

>  	for (i = 0; i < blocklist_size; i++) {
>  		if (strstr(blocklist[i], vendor_name) != NULL)
>  			return true;
> -- 
> 2.34.1
> 


More information about the igt-dev mailing list