Skip to contentSkip to conversation

net: defxx: Fix warning of uninitialized variable

PATCH In review Deepa Dinamani 2 participants 2 messages Oct 1, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: defxx: Fix warning of uninitialized variable

This adds explicit initialization of bar_start and bar_len resource arrays in accordance with the compiler warning.

---
 drivers/net/fddi/defxx.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/fddi/defxx.c +3 -0
index 7f975a2..bd73948 100644
@@ -439,6 +439,9 @@ static void dfx_get_bars(struct device *bdev,
 	int dfx_bus_tc = DFX_BUS_TC(bdev);
 	int dfx_use_mmio = DFX_MMIO || dfx_bus_tc;
 
+	memset(bar_start, 0, sizeof(resource_size_t) * 3);
+	memset(bar_len, 0, sizeof(resource_size_t) * 3);
+
 	if (dfx_bus_pci) {
 		int num = dfx_use_mmio ? 0 : 1;
 
Signature · 1 line
1.9.1
#1 lore raw
Quoted 6 lines · Deepa Dinamani

This adds explicit initialization of bar_start and bar_len resource arrays in accordance with the compiler warning.

---
 drivers/net/fddi/defxx.c | 3 +++

Note, we can't do anything with patches outside of drivers/staging/ in the kernel tree for the Outreachy application process, sorry. I'd recommend staying away from other parts of the kernel right now, unless the mentor you have contacted tells you otherwise.

thanks,

greg k-h