diff --git a/drivers/soc/qcom/memshare/msm_memshare.c b/drivers/soc/qcom/memshare/msm_memshare.c index 6d1badcf1afd..43ca69072932 100644 --- a/drivers/soc/qcom/memshare/msm_memshare.c +++ b/drivers/soc/qcom/memshare/msm_memshare.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* Copyright (c) 2013-2020, The Linux Foundation. All rights reserved. - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2023, Qualcomm Innovation Center, Inc. All rights reserved. */ #include @@ -104,7 +104,7 @@ static int check_client(int client_id, int proc, int request) int i = 0, rc; int found = DHMS_MEM_CLIENT_INVALID; - for (i = 0; i < MAX_CLIENTS; i++) { + for (i = 0; i < num_clients; i++) { if (memblock[i].client_id == client_id && memblock[i].peripheral == proc) { found = i; @@ -484,7 +484,7 @@ static void handle_alloc_generic_req(struct qmi_handle *handle, return; } - for (i = 0; i < MAX_CLIENTS; i++) { + for (i = 0; i < num_clients; i++) { if (memsh_child[i]->client_id == alloc_req->client_id) { client_node = memsh_child[i]; dev_info(memsh_drv->dev, @@ -577,7 +577,7 @@ static void handle_free_generic_req(struct qmi_handle *handle, flag = 1; } - for (i = 0; i < MAX_CLIENTS; i++) { + for (i = 0; i < num_clients; i++) { if (memsh_child[i]->client_id == free_req->client_id) { client_node = memsh_child[i]; dev_info(memsh_drv->dev,