提交 2f9be1e9 编写于 作者: A Alex Elder 提交者: David S. Miller

net: ipa: validate memory regions at init time

Move the memory region validation check so it happens earlier when
initializing the driver, at init time rather than config time (i.e.,
before access to hardware is required).
Signed-off-by: NAlex Elder <elder@linaro.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 5e57c6c5
......@@ -215,10 +215,6 @@ int ipa_mem_config(struct ipa *ipa)
ipa->zero_virt = virt;
ipa->zero_size = IPA_MEM_MAX;
/* Make sure all defined memory regions are valid */
if (!ipa_mem_valid(ipa))
goto err_dma_free;
/* For each region, write "canary" values in the space prior to
* the region's base address if indicated.
*/
......@@ -528,6 +524,10 @@ int ipa_mem_init(struct ipa *ipa, const struct ipa_mem_data *mem_data)
ipa->mem_count = mem_data->local_count;
ipa->mem = mem_data->local;
/* Make sure all defined memory regions are valid */
if (!ipa_mem_valid(ipa))
goto err_unmap;
ret = ipa_imem_init(ipa, mem_data->imem_addr, mem_data->imem_size);
if (ret)
goto err_unmap;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册