Skip to contentSkip to conversation

x86/resctrl: fix the uninitialized variable warning

PATCH New Moger, Babu 1 participant 1 message Nov 28, 2018

Subsystems (2)
lore
Share & tools
lore

Moger, Babu

author reviewer
#0 lore raw

PATCH v2 1/1 x86/resctrl: fix the uninitialized variable warning

Fix the following compiler warning caused by recent change.

arch/x86/kernel/cpu/resctrl/ctrlmondata.c:227 parse_cbm()
error: uninitialized symbol 'cbm_val'

Fixes a36c5ff560fb ("x86/resctrl: Bring cbm_validate() into the resource structure")

---
v1->v2
Added the actual warning.

 arch/x86/kernel/cpu/resctrl/ctrlmondata.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/cpu/resctrl/ctrlmondata.c +1 -1
index 03ee13235a45..2477cb196735 100644
@@ -202,7 +202,7 @@ int parse_cbm(struct rdt_parse_data *data, struct rdt_resource *r,
 	      struct rdt_domain *d)
 {
 	struct rdtgroup *rdtgrp = data->rdtgrp;
-	u32 cbm_val;
+	u32 cbm_val = 0;
 
 	if (d->have_new_ctrl) {
 		rdt_last_cmd_printf("Duplicate domain %d\n", d->id);
Signature · 1 line
2.17.1