oc: qcom: rpm-smd-debug: Fix potential memory leaks

Fix memory leak due to rpm request not freed during error conditions.

Change-Id: I440a58bf452e76c8886f7bcd8f89b24698a301e9
Signed-off-by: Raghavendra Kakarla <rkakarla@codeaurora.org>
This commit is contained in:
Raghavendra Kakarla 2017-12-21 16:24:31 +05:30 committed by Gerrit - the friendly Code Review server
parent c4b0fbe69e
commit faee7b6dce
1 changed files with 4 additions and 4 deletions

View File

@ -99,23 +99,23 @@ static ssize_t rsc_ops_write(struct file *fp, const char __user *user_buffer,
cmp += pos;
if (sscanf(cmp, "%5s %n", key_str, &pos) != 1) {
pr_err("Invalid number of arguments passed\n");
goto err;
goto err_request;
}
if (strlen(key_str) > 4) {
pr_err("Key value cannot be more than 4 charecters");
goto err;
goto err_request;
}
key = string_to_uint(key_str);
if (!key) {
pr_err("Key values entered incorrectly\n");
goto err;
goto err_request;
}
cmp += pos;
if (sscanf(cmp, "%u %n", &data, &pos) != 1) {
pr_err("Invalid number of arguments passed\n");
goto err;
goto err_request;
}
if (msm_rpm_add_kvp_data(req, key,