diff options
author | jitendrathakare <jitendrathakare@codeaurora.org> | 2019-09-12 19:46:48 +0530 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2019-10-22 03:46:39 -0700 |
commit | c5ca3ffaa4083d01d395c76b16650793c078f869 (patch) | |
tree | 8ec20503b0c9fd28f8193e202e10508ed24497e3 /drivers/misc/qseecom.c | |
parent | dd4645c977feb6cef4d7f598abd8864cc7b7e878 (diff) |
qseecom : Clear client handle after unmap the resources
When unloading the app, reset all client members to NULL
to protect from accessing the memory after being freed.
Change-Id: I573b9c6fde03539522d2b04724a2246660c62518
Signed-off-by: jitendra thakare <jitendrathakare@codeaurora.org>
Diffstat (limited to 'drivers/misc/qseecom.c')
-rw-r--r-- | drivers/misc/qseecom.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/misc/qseecom.c b/drivers/misc/qseecom.c index dfa3bb6b186f..d50144e0fed9 100644 --- a/drivers/misc/qseecom.c +++ b/drivers/misc/qseecom.c @@ -2533,7 +2533,8 @@ static int qseecom_unmap_ion_allocated_memory(struct qseecom_dev_handle *data) if (!IS_ERR_OR_NULL(data->client.ihandle)) { ion_unmap_kernel(qseecom.ion_clnt, data->client.ihandle); ion_free(qseecom.ion_clnt, data->client.ihandle); - data->client.ihandle = NULL; + memset((void *)&data->client, + 0, sizeof(struct qseecom_client_handle)); } return ret; } |