linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] PCI: brcmstb: Fix missing mutex_init()
@ 2020-01-19  2:30 Wei Yongjun
  2020-01-19 17:50 ` Florian Fainelli
  0 siblings, 1 reply; 3+ messages in thread
From: Wei Yongjun @ 2020-01-19  2:30 UTC (permalink / raw)
  To: Lorenzo Pieralisi, Andrew Murray, Bjorn Helgaas, Florian Fainelli,
	Jim Quinlan
  Cc: Wei Yongjun, bcm-kernel-feedback-list, linux-pci,
	linux-arm-kernel, kernel-janitors

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")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/pci/controller/pcie-brcmstb.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c
index 43cba76c0e1e..065bada9cfad 100644
--- a/drivers/pci/controller/pcie-brcmstb.c
+++ b/drivers/pci/controller/pcie-brcmstb.c
@@ -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;




^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-01-20 10:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-19  2:30 [PATCH -next] PCI: brcmstb: Fix missing mutex_init() Wei Yongjun
2020-01-19 17:50 ` Florian Fainelli
2020-01-20 10:54   ` Lorenzo Pieralisi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).