[Intel-wired-lan] [PATCH net v6] i40e: Fix DMA mappings leak

Keller, Jacob E jacob.e.keller at intel.com
Tue Oct 11 18:46:24 UTC 2022


> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces at osuosl.org> On Behalf Of
> Mateusz Palczewski
> Sent: Tuesday, October 11, 2022 3:13 AM
> To: intel-wired-lan at lists.osuosl.org
> Cc: Rout, ChandanX <chandanx.rout at intel.com>
> Subject: [Intel-wired-lan] [PATCH net v6] i40e: Fix DMA mappings leak
> 
> From: Jan Sokolowski <jan.sokolowski at intel.com>

I noticed an issue while looking into applying this to IWL dev-queue:

<snip>

> +	if (!i40e_enabled_xdp_vsi(vsi) && prog)
> +		if (i40e_realloc_rx_bi_zc(vsi, true))
> +			return -ENOMEM;
> +	else if (i40e_enabled_xdp_vsi(vsi) && !prog)
> +		if (i40e_realloc_rx_bi_zc(vsi, false))
> +			return -ENOMEM;


This hunk results in the following warning from GCC:

../drivers/net/ethernet/intel/i40e/i40e_main.c:13292:5: warning: suggest explicit braces to avoid ambiguous 'else' [-Wdangling-else]
  if (!i40e_enabled_xdp_vsi(vsi) && prog)
     ^

This is both potentially ambiguous to parse, as the following else block could theoretically be applied to either the first if or second if statement. Additionally, its a bit difficult to process because there are multiple lines inside the if statement.

Thanks,
Jake


More information about the Intel-wired-lan mailing list