diff options
author | Avaneesh Kumar Dwivedi <akdwived@codeaurora.org> | 2017-04-24 21:51:42 +0530 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-04-28 05:28:51 -0700 |
commit | b6bd6d1a3c8d4140a1bb9c1011a4c52bf42e46dd (patch) | |
tree | 484a77d5407f0a3a3997b521f12b6b68451fd18c /drivers | |
parent | c01ba1a5f98de6e2f271cc2e447fe3280920cc16 (diff) |
soc: qcom: Clear the memory before freeing it up
It is a case of write after free, this is causing page allocation
failure due to corruption. This is due to freeing up of segments
allocated for venus subsystem, when venus fw loading fail midway.
Change-Id: I0019a05b1d1336dcf361264607597430e5f1625a
Signed-off-by: Avaneesh Kumar Dwivedi <akdwived@codeaurora.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/soc/qcom/peripheral-loader.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/soc/qcom/peripheral-loader.c b/drivers/soc/qcom/peripheral-loader.c index 6e5ddc4a3a7d..3415338a1294 100644 --- a/drivers/soc/qcom/peripheral-loader.c +++ b/drivers/soc/qcom/peripheral-loader.c @@ -917,13 +917,13 @@ out: priv->region_start), VMID_HLOS); } + if (desc->clear_fw_region && priv->region_start) + pil_clear_segment(desc); dma_free_attrs(desc->dev, priv->region_size, priv->region, priv->region_start, &desc->attrs); priv->region = NULL; } - if (desc->clear_fw_region && priv->region_start) - pil_clear_segment(desc); pil_release_mmap(desc); } return ret; |