Skip to contentSkip to conversation

net: ipa: initialize all resources

PATCH New Alex Elder 1 participant 1 message Feb 15, 2021

Subsystems (3)
lore
Share & tools
lore

Alex Elder

author
#0 lore raw

PATCH 1/1 net: ipa: initialize all resources

We configure the minimum and maximum number of various types of IPA resources in ipa_resource_config(). It iterates over resource types in the configuration data and assigns resource limits to each resource group for each type.

Unfortunately, we are repeatedly initializing the resource data for the first type, rather than initializing each of the types whose limits are specified.

Fix this bug.

Fixes 4a0d7579d466e ("net: ipa: avoid going past end of resource group array")
---
 drivers/net/ipa/ipa_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ipa/ipa_main.c +2 -2
index 84bb8ae927252..eb1c8396bcdd9 100644
@@ -581,10 +581,10 @@ ipa_resource_config(struct ipa *ipa, const struct ipa_resource_data *data)
 		return -EINVAL;
 
 	for (i = 0; i < data->resource_src_count; i++)
-		ipa_resource_config_src(ipa, data->resource_src);
+		ipa_resource_config_src(ipa, &data->resource_src[i]);
 
 	for (i = 0; i < data->resource_dst_count; i++)
-		ipa_resource_config_dst(ipa, data->resource_dst);
+		ipa_resource_config_dst(ipa, &data->resource_dst[i]);
 
 	return 0;
 }
Signature · 1 line
2.20.1