summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLei wang <leiwan@codeaurora.org>2018-03-07 13:57:31 +0800
committerGerrit - the friendly Code Review server <code-review@localhost>2018-03-06 22:04:33 -0800
commit94e90bcf7f54ec6a6a80d2d75b064932515d5909 (patch)
treecf3ad0fa15c2b0c2ca24788608208189c5feb82b
parent99b73ed59a2865a23d0106c4392b6efe31fb5342 (diff)
profiler: memset cnt_buf before use
fix cnf_buf.cmd is uninitialized in bw_profiling_get Change-Id: I9638fe423e6768c66a85e80c0d5175b8a33c1901 Signed-off-by: Lei wang <leiwan@codeaurora.org>
-rw-r--r--drivers/misc/profiler.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/misc/profiler.c b/drivers/misc/profiler.c
index a2887fcefbab..92e6a6651b68 100644
--- a/drivers/misc/profiler.c
+++ b/drivers/misc/profiler.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -169,6 +169,7 @@ static int bw_profiling_get(void __user *argp, struct tz_bw_svc_buf *bwbuf)
const int numberofregs = 3;
struct profiler_bw_cntrs_req cnt_buf;
+ memset(&cnt_buf, 0, sizeof(cnt_buf));
bwgetreq = (struct tz_bw_svc_get_req *) &bwbuf->bwreq;
/* Allocate memory for get buffer */
buf = kzalloc(PAGE_ALIGN(numberofregs * sizeof(uint32_t)), GFP_KERNEL);