Skip to contentSkip to conversation

PCI: brcmstb: Fix missing mutex_init()

PATCH In review Wei Yongjun 3 participants 3 messages Jan 19, 2020 – Jan 20, 2020

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

PATCH 1/1 PCI: brcmstb: Fix missing mutex_init()

The driver allocates the mutex but not initialize it. Use mutex_init() on it to initialize it correctly.

This is detected by Coccinelle semantic patch.

Fixes 72af6f6f0d13 ("PCI: brcmstb: Add MSI support")
---
 drivers/pci/controller/pcie-brcmstb.c | 1 +
 1 file changed, 1 insertion(+)
drivers/pci/controller/pcie-brcmstb.c +1 -0
index 43cba76c0e1e..065bada9cfad 100644
@@ -528,6 +528,7 @@ static int brcm_pcie_enable_msi(struct brcm_pcie *pcie)
 	if (!msi)
 		return -ENOMEM;
 
+	mutex_init(&msi->lock);
 	msi->dev = dev;
 	msi->base = pcie->base;
 	msi->np = pcie->np;
#2 lore raw
Quoted 6 lines · Florian Fainelli
Quoted 3 lines · Wei Yongjun

The driver allocates the mutex but not initialize it. Use mutex_init() on it to initialize it correctly.

Quoted 6 lines
Quoted 4 lines

This is detected by Coccinelle semantic patch.

Fixes 72af6f6f0d13 ("PCI: brcmstb: Add MSI support")

I have squashed it in in my pci/brcmstb branch, thanks.

Lorenzo