Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c90c4f24 authored by Raghavendra Kakarla's avatar Raghavendra Kakarla Committed by Gerrit - the friendly Code Review server
Browse files

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: default avatarRaghavendra Kakarla <rkakarla@codeaurora.org>
parent aaa974b1
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -90,23 +90,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,