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

Commit e373aba0 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "profiler: Fix Possible memory leak"

parents 5720340d 86136f9a
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -226,16 +226,16 @@ static int profiler_get_bw_info(void __user *argp)
	struct tz_bw_svc_buf *bwbuf = NULL;
	struct profiler_bw_cntrs_req cnt_buf;

	/* Allocate memory for request */
	bwbuf = kzalloc(PAGE_ALIGN(sizeof(struct tz_bw_svc_buf)), GFP_KERNEL);
	if (bwbuf == NULL)
		return -ENOMEM;
	ret = copy_from_user(&cnt_buf, argp,
				sizeof(struct profiler_bw_cntrs_req));
	if (ret) {
		pr_err("copy_from_user failed\n");
		return ret;
	}
	/* Allocate memory for request */
	bwbuf = kzalloc(PAGE_ALIGN(sizeof(struct tz_bw_svc_buf)), GFP_KERNEL);
	if (bwbuf == NULL)
		return -ENOMEM;
	switch (cnt_buf.cmd) {
	case TZ_BW_SVC_START_ID: {
		ret = bw_profiling_start(bwbuf);
@@ -257,7 +257,7 @@ static int profiler_get_bw_info(void __user *argp)
	}
	default:
		pr_err("Invalid IOCTL: 0x%x\n", cnt_buf.cmd);
		return -EINVAL;
		ret = -EINVAL;
	}
	/* Free memory for command */
	if (bwbuf != NULL) {