diff mbox series

[v8,2/5] soc: qcom: pdr: fix parsing of domains lists

Message ID 20240512-qcom-pd-mapper-v8-2-5ecbb276fcc0@linaro.org (mailing list archive)
State Superseded
Headers show
Series soc: qcom: add in-kernel pd-mapper implementation | expand

Commit Message

Dmitry Baryshkov May 11, 2024, 9:56 p.m. UTC
While parsing the domains list, start offsets from 0 rather than from
domains_read. The domains_read is equal to the total count of the
domains we have seen, while the domains list in the message starts from
offset 0.

Fixes: fbe639b44a82 ("soc: qcom: Introduce Protection Domain Restart helpers")
Tested-by: Steev Klimaszewski <steev@kali.org>
Tested-by: Alexey Minnekhanov <alexeymin@postmarketos.org>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 drivers/soc/qcom/pdr_interface.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Chris Lew June 6, 2024, 12:39 a.m. UTC | #1
On 5/11/2024 2:56 PM, Dmitry Baryshkov wrote:
> While parsing the domains list, start offsets from 0 rather than from
> domains_read. The domains_read is equal to the total count of the
> domains we have seen, while the domains list in the message starts from
> offset 0.
> 
> Fixes: fbe639b44a82 ("soc: qcom: Introduce Protection Domain Restart helpers")
> Tested-by: Steev Klimaszewski <steev@kali.org>
> Tested-by: Alexey Minnekhanov <alexeymin@postmarketos.org>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
>   drivers/soc/qcom/pdr_interface.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/soc/qcom/pdr_interface.c b/drivers/soc/qcom/pdr_interface.c
> index e014dd2d8ab3..d495ee736519 100644
> --- a/drivers/soc/qcom/pdr_interface.c
> +++ b/drivers/soc/qcom/pdr_interface.c
> @@ -422,7 +422,7 @@ static int pdr_locate_service(struct pdr_handle *pdr, struct pdr_service *pds)
>   		if (ret < 0)
>   			goto out;
>   
> -		for (i = domains_read; i < resp->domain_list_len; i++) {
> +		for (i = 0; i < resp->domain_list_len; i++) {
>   			entry = &resp->domain_list[i];
>   
>   			if (strnlen(entry->name, sizeof(entry->name)) == sizeof(entry->name))
> 

Reviewed-by: Chris Lew <quic_clew@quicinc.com>
diff mbox series

Patch

diff --git a/drivers/soc/qcom/pdr_interface.c b/drivers/soc/qcom/pdr_interface.c
index e014dd2d8ab3..d495ee736519 100644
--- a/drivers/soc/qcom/pdr_interface.c
+++ b/drivers/soc/qcom/pdr_interface.c
@@ -422,7 +422,7 @@  static int pdr_locate_service(struct pdr_handle *pdr, struct pdr_service *pds)
 		if (ret < 0)
 			goto out;
 
-		for (i = domains_read; i < resp->domain_list_len; i++) {
+		for (i = 0; i < resp->domain_list_len; i++) {
 			entry = &resp->domain_list[i];
 
 			if (strnlen(entry->name, sizeof(entry->name)) == sizeof(entry->name))