]> git.droids-corp.org - dpdk.git/blobdiff - drivers/net/bnxt/tf_core/tf_session.c
net/bnxt: cleanup and refactor session management
[dpdk.git] / drivers / net / bnxt / tf_core / tf_session.c
index 6ab8088f0f67aabe1ae12f0a31b30b5d9f04ce83..c95c4bdbd3b8480c3a112333492d29124e3afc83 100644 (file)
@@ -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 */