/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2019-2020 Broadcom
+ * Copyright(c) 2019-2021 Broadcom
* All rights reserved.
*/
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 */