mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-24 10:11:26 +03:00
nvidia: fix memory leak issue in vse driver
fixing memory leak driver by using krealloc API to reutilize the previously allocated memory Bug 4334915 Change-Id: I4ad88f32152da7527033679b1eed414574cad4e5 Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3010174 Reviewed-by: Advaya Andhare <aandhare@nvidia.com> Reviewed-by: Sandeep Trasi <strasi@nvidia.com> GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
d6745fa37c
commit
ef1bc16ac8
@@ -344,11 +344,12 @@ static int tnvvse_crypto_sha_update(struct tnvvse_crypto_ctx *ctx,
|
||||
else
|
||||
buffer_size = update_ctl->input_buffer_size;
|
||||
|
||||
sha_state->in_buf = kzalloc(buffer_size, GFP_KERNEL);
|
||||
sha_state->in_buf = krealloc(sha_state->in_buf, buffer_size, GFP_KERNEL);
|
||||
if (sha_state->in_buf == NULL) {
|
||||
ret = -ENOMEM;
|
||||
goto stop_sha;
|
||||
}
|
||||
memset(sha_state->in_buf, 0, buffer_size);
|
||||
|
||||
/* copy input buffer */
|
||||
if (copy_from_user((void *)sha_state->in_buf, input_buffer, update_ctl->input_buffer_size)) {
|
||||
|
||||
Reference in New Issue
Block a user