net/bnxt: add CFA subdirectory of HCAPI
[dpdk.git] / drivers / net / bnxt / tf_core / tf_session.c
index 6ab8088..6335ad3 100644 (file)
@@ -1,5 +1,5 @@
 /* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2019-2020 Broadcom
+ * Copyright(c) 2019-2021 Broadcom
  * All rights reserved.
  */
 
@@ -472,6 +472,14 @@ tf_session_close_session(struct tf *tfp,
 
        client = tf_session_find_session_client_by_fid(tfs,
                                                       fid);
+       if (!client) {
+               rc = -EINVAL;
+               TFP_DRV_LOG(ERR,
+                           "Client not part of the session, unable to close, rc:%s\n",
+                           strerror(-rc));
+               return rc;
+       }
+
        /* In case multiple clients we chose to close those first */
        if (tfs->ref_count > 1) {
                /* Linaro gcc can't static init this structure */