Skip to contentSkip to conversation

X86:PCI: Fix an uninitialized variable warning

PATCH Applied [email protected] 2 participants 3 messages Apr 4, 2011 – Apr 13, 2011 PCI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 X86:PCI: Fix an uninitialized variable warning

From: Wanlong Gao <[email protected]>

If it was preempted , and the variable aer_mask_override is changed after the spin_unlock_irqrestore , it will write an uninitialized variable by the pci_write_config_dword() function .

---
 drivers/pci/pcie/aer/aer_inject.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/pci/pcie/aer/aer_inject.c +1 -1
index f62079f..95489cd
@@ -326,7 +326,7 @@ static int aer_inject(struct aer_error_inj *einj)
 	unsigned long flags;
 	unsigned int devfn = PCI_DEVFN(einj->dev, einj->fn);
 	int pos_cap_err, rp_pos_cap_err;
-	u32 sever, cor_mask, uncor_mask, cor_mask_orig, uncor_mask_orig;
+	u32 sever, cor_mask, uncor_mask, cor_mask_orig = 0, uncor_mask_orig = 0;
 	int ret = 0;
 
 	dev = pci_get_domain_bus_and_slot((int)einj->domain, einj->bus, devfn);
Signature · 1 line
1.7.3
Applied
#1 lore raw
Quoted 5 lines · On Mon, 4 Apr 2011 17:12:59 +0800 [email protected] wrote:

From: Wanlong Gao <[email protected]>

If it was preempted , and the variable aer_mask_override is changed after the spin_unlock_irqrestore , it will write an uninitialized variable by the pci_write_config_dword() function .

Applied to my linux-next branch, thanks.

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
#2 lore raw
Quoted 10 lines · Jesse Barnes
Quoted 5 lines · On Mon, 4 Apr 2011 17:12:59 +0800 [email protected] wrote:

From: Wanlong Gao <[email protected]>

If it was preempted , and the variable aer_mask_override is changed after the spin_unlock_irqrestore , it will write an uninitialized variable by the pci_write_config_dword() function .

Applied to my linux-next branch, thanks.

Thank you for your hard work to the open-source .

Best regards .

Quoted 4 lines

--
Jesse Barnes, Intel Open Source Technology Center

Signature · 2 lines
Best regards
Wanlong Gao