rss_data->rss_key needs to be nullified after it is freed.
Checks like "if (!rss_data->rss_key)" in the code could fail
if it is not nullified.

Tested: built and booted the kernel.

Fixes: 83f38f210b85 ("idpf: Fix RSS LUT NULL pointer crash on early ethtool 
operations")
Signed-off-by: Li Li <[email protected]>
---
Changes in v2:
 - Remove the line to nullify vport->q_vector_idxs as it is not
   necessary.

 drivers/net/ethernet/intel/idpf/idpf_lib.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/intel/idpf/idpf_lib.c 
b/drivers/net/ethernet/intel/idpf/idpf_lib.c
index 131a8121839bd..f63ab58428d2e 100644
--- a/drivers/net/ethernet/intel/idpf/idpf_lib.c
+++ b/drivers/net/ethernet/intel/idpf/idpf_lib.c
@@ -1308,6 +1308,7 @@ static struct idpf_vport *idpf_vport_alloc(struct 
idpf_adapter *adapter,
 
 free_rss_key:
        kfree(rss_data->rss_key);
+       rss_data->rss_key = NULL;
 free_vector_idxs:
        kfree(vport->q_vector_idxs);
 free_vport:
-- 
2.52.0.457.g6b5491de43-goog

Reply via email to