summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDilip Kota <dkota@codeaurora.org>2017-09-04 14:36:43 +0530
committerShrey Vijay <shreyv@codeaurora.org>2018-03-20 19:25:09 +0530
commite98ad551291f0c946ac00fb1508b45cc8c3aaee7 (patch)
tree73a2dfa25c561330e786df54bfcb19fa1d2e2fa5
parent8e181ea4e865a2245124116afee0d9f71ccd43aa (diff)
slimbus: Avoid uninitialized variable access
Avoid reading uninitalized variables. Initialize it to default value before reading. Change-Id: Ic34dfec16357cbc4992912e883f21f014cf8a66c Signed-off-by: Dilip Kota <dkota@codeaurora.org> Signed-off-by: Shrey Vijay <shreyv@codeaurora.org>
-rw-r--r--drivers/slimbus/slimbus.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/slimbus/slimbus.c b/drivers/slimbus/slimbus.c
index 0819395a5e65..72ac5b80f13e 100644
--- a/drivers/slimbus/slimbus.c
+++ b/drivers/slimbus/slimbus.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011-2016, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2011-2017, 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
@@ -2337,6 +2337,9 @@ static int slim_sched_chans(struct slim_device *sb, u32 clkgear,
int opensl1[6];
bool opensl1valid = false;
int maxctrlw1, maxctrlw3, i;
+
+ /* intitalize array to zero */
+ memset(opensl1, 0x0, sizeof(opensl1));
finalexp = (ctrl->sched.chc3[last3])->rootexp;
if (last1 >= 0) {
slc1 = ctrl->sched.chc1[coeff1];