linux/drivers/net/ethernet/intel/iavf
Jacob Keller 4f04008038 iavf: prevent accidental free of filter structure
In iavf_config_clsflower, the filter structure could be accidentally
released at the end, if iavf_parse_cls_flower or iavf_handle_tclass ever
return a non-zero but positive value.

In this case, the function continues through to the end, and will call
kfree() on the filter structure even though it has been added to the
linked list.

This can actually happen because iavf_parse_cls_flower will return
a positive IAVF_ERR_CONFIG value instead of the traditional negative
error codes.

Fix this by ensuring that the kfree() check and error checks are
similar. Use the more idiomatic "if (err)" to catch all non-zero error
codes.

Fixes: 0075fa0fad ("i40evf: Add support to apply cloud filters")
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Tony Brelinski <tony.brelinski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
2021-11-15 15:40:04 -08:00
..
iavf_adminq_cmd.h iavf: replace i40e variables with iavf 2019-05-31 01:02:53 -07:00
iavf_adminq.c iavf: change remaining i40e defines to be iavf 2019-05-31 01:03:17 -07:00
iavf_adminq.h intel-ethernet: clean up W=1 warnings in kdoc 2020-09-25 16:28:59 -07:00
iavf_adv_rss.c iavf: Support for modifying SCTP RSS flow hashing 2021-04-22 09:26:23 -07:00
iavf_adv_rss.h iavf: Support for modifying SCTP RSS flow hashing 2021-04-22 09:26:23 -07:00
iavf_alloc.h iavf: change iavf_status_code to iavf_status 2019-05-31 00:19:33 -07:00
iavf_client.c iavf: update comments and file checks to match iavf 2019-05-31 01:03:24 -07:00
iavf_client.h iavf: rename iavf_client.h defines to match driver name 2019-05-31 01:03:13 -07:00
iavf_common.c iavf: clean up packet type lookup table 2021-06-18 09:04:44 -07:00
iavf_devids.h
iavf_ethtool.c iavf: Fix return of set the new channel count 2021-11-15 15:39:36 -08:00
iavf_fdir.c iavf: redefine the magic number for FDIR GTP-U header fields 2021-04-23 09:34:19 -07:00
iavf_fdir.h iavf: change the flex-byte support number to macro definition 2021-04-23 09:03:56 -07:00
iavf_main.c iavf: prevent accidental free of filter structure 2021-11-15 15:40:04 -08:00
iavf_osdep.h iavf: Fix up debug print macro 2019-06-28 15:59:56 -07:00
iavf_prototype.h iavf: replace i40e variables with iavf 2019-05-31 01:02:53 -07:00
iavf_register.h
iavf_status.h iavf: rename iavf_status structure flags 2019-05-31 01:03:04 -07:00
iavf_trace.h intel-ethernet: clean up W=1 warnings in kdoc 2020-09-25 16:28:59 -07:00
iavf_txrx.c iavf: add support for UDP Segmentation Offload 2021-04-22 09:26:22 -07:00
iavf_txrx.h intel-ethernet: clean up W=1 warnings in kdoc 2020-09-25 16:28:59 -07:00
iavf_type.h iavf: clean up packet type lookup table 2021-06-18 09:04:44 -07:00
iavf_virtchnl.c iavf: Refactor iavf state machine tracking 2021-10-18 14:07:16 -07:00
iavf.h iavf: Fix kernel BUG in free_msi_irqs 2021-10-29 13:11:53 -07:00
Makefile iavf: Support for modifying TCP RSS flow hashing 2021-04-22 09:26:23 -07:00