From 5559ceed4646ffe2e13a32b9216c3701efab6fca Mon Sep 17 00:00:00 2001 From: Satya Durga Srinivasu Prabhala Date: Mon, 27 Mar 2017 13:10:09 -0700 Subject: [PATCH] soc: qcom: service-locator: Return in case of no matching domains found If no matching domains found in response to the request, return error instead of going ahead with memory allocation which would lead to other issues. CRs-Fixed: 2025293 Change-Id: I327b3494812cddc643f6b355c04f85f4baa7c399 Signed-off-by: Satya Durga Srinivasu Prabhala --- drivers/soc/qcom/service-locator.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/soc/qcom/service-locator.c b/drivers/soc/qcom/service-locator.c index 5ac2a58899f4..0625f75de373 100644 --- a/drivers/soc/qcom/service-locator.c +++ b/drivers/soc/qcom/service-locator.c @@ -266,8 +266,10 @@ static int service_locator_send_msg(struct pd_qmi_client_data *pd) if (!domains_read) { db_rev_count = pd->db_rev_count = resp->db_rev_count; pd->total_domains = resp->total_domains; - if (!resp->total_domains) - pr_info("No matching domains found\n"); + if (!resp->total_domains) { + pr_err("No matching domains found\n"); + goto out; + } pd->domain_list = kmalloc( sizeof(struct servreg_loc_entry_v01) *