net/bnxt: cleanup and check ULP context allocation
authorSomnath Kotur <somnath.kotur@broadcom.com>
Wed, 29 Jul 2020 14:04:58 +0000 (19:34 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 18 Sep 2020 16:55:07 +0000 (18:55 +0200)
commitb308d5a2a7a7a09e921005271ab3bbeedf077e96
treef9673b4d146e17a924cbd349cc6b18bd7801cac1
parenta3fb481289ea0b91205d3a92d76858267b363599
net/bnxt: cleanup and check ULP context allocation

Set ulp_ctx explicitly to NULL in ulp_ctx_deinit() so that representor
init is aborted if parent ulp context is not initialized.
Also check for the same before creation of port default rules.
Additional checks added in VF rep dev ops for proper parent dev
initialization, to avoid null pointer dereference.

Fixes: 322bd6e70272 ("net/bnxt: add port representor infrastructure")
Fixes: 313ac35ac701 ("net/bnxt: support ULP session manager init")
Cc: stable@dpdk.org
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
drivers/net/bnxt/bnxt_reps.c
drivers/net/bnxt/tf_ulp/bnxt_ulp.c
drivers/net/bnxt/tf_ulp/ulp_def_rules.c