aboutsummaryrefslogtreecommitdiff
path: root/drivers/video
diff options
context:
space:
mode:
authorDennis Cagle <d-cagle@codeaurora.org>2016-08-01 11:48:04 -0700
committerMister Oyster <oysterized@gmail.com>2017-04-11 10:59:21 +0200
commite1a80ae35859cfc9bf0496091e6cf3fbdf0f3bad (patch)
tree2ab6cee8915332555d7fd6f90e55fecde14bcd1c /drivers/video
parentb34d1c7086613f66cbbc48942b5368f066d295a0 (diff)
adf: Zero out the mapping data
The adf_device_post_nocopy function eventually calls the dma_buf_attach and dma_buf_map_attachment functions. If the dma_buf_attach function succeeds but the dma_buf_map_attachment function fails, both the adf_buffer_map function and the adf_device_post_nocopy function will call the dma_buf_detach function to tear down the same dma-buf attachment. b/28447556 Change-Id: I8eb40486496fe2a2ae5dfa1be4b76a4af0d6b827 Signed-off-by: Dennis Cagle <d-cagle@codeaurora.org>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/adf/adf_client.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/video/adf/adf_client.c b/drivers/video/adf/adf_client.c
index 8061d8e6b..75b2f0b18 100644
--- a/drivers/video/adf/adf_client.c
+++ b/drivers/video/adf/adf_client.c
@@ -305,8 +305,10 @@ static int adf_buffer_map(struct adf_device *dev, struct adf_buffer *buf,
}
done:
- if (ret < 0)
+ if (ret < 0) {
adf_buffer_mapping_cleanup(mapping, buf);
+ memset(mapping, 0, sizeof(*mapping));
+ }
return ret;
}