Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1569396 > unrolled thread
| Started by | Shailendra Verma <shailendra.v@samsung.com> |
|---|---|
| First post | 2017-01-30 06:10 +0100 |
| Last post | 2017-01-30 06:10 +0100 |
| Articles | 1 — 1 participant |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH] Pci: host - Fix possible NULL derefrence. Shailendra Verma <shailendra.v@samsung.com> - 2017-01-30 06:10 +0100
| From | Shailendra Verma <shailendra.v@samsung.com> |
|---|---|
| Date | 2017-01-30 06:10 +0100 |
| Subject | [PATCH] Pci: host - Fix possible NULL derefrence. |
| Message-ID | <t5co1-8ip-17@gated-at.bofh.it> |
of_match_device could return NULL, and so can cause a NULL
pointer dereference later.
Signed-off-by: Shailendra Verma <shailendra.v@samsung.com>
---
drivers/pci/host/pcie-hisi.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/pci/host/pcie-hisi.c b/drivers/pci/host/pcie-hisi.c
index 56154c2..3256f8f 100644
--- a/drivers/pci/host/pcie-hisi.c
+++ b/drivers/pci/host/pcie-hisi.c
@@ -174,6 +174,10 @@ static int hisi_pcie_probe(struct platform_device *pdev)
driver = dev->driver;
match = of_match_device(driver->of_match_table, dev);
+ if (!match) {
+ dev_err(dev, "Error: No device match found\n");
+ return -ENODEV;
+ }
hisi_pcie->soc_ops = (struct pcie_soc_ops *) match->data;
hisi_pcie->subctrl =
--
1.7.9.5
Back to top | Article view | linux.kernel
csiph-web