Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1569388
| From | Shailendra Verma <shailendra.v@samsung.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH] Gpu: drm: tegra - Fix possible NULL derefrence. |
| Date | 2017-01-30 06:00 +0100 |
| Message-ID | <t5cem-804-17@gated-at.bofh.it> (permalink) |
| References | <t5cem-804-19@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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/gpu/drm/tegra/sor.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c
index 74d0540..34f032f 100644
--- a/drivers/gpu/drm/tegra/sor.c
+++ b/drivers/gpu/drm/tegra/sor.c
@@ -2540,6 +2540,10 @@ static int tegra_sor_probe(struct platform_device *pdev)
int err;
match = of_match_device(tegra_sor_of_match, &pdev->dev);
+ if (!match) {
+ dev_err(&pdev->dev, "Error: No device match found\n");
+ return -ENODEV;
+ }
sor = devm_kzalloc(&pdev->dev, sizeof(*sor), GFP_KERNEL);
if (!sor)
--
1.7.9.5
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH] Gpu: drm: tegra - Fix possible NULL derefrence. Shailendra Verma <shailendra.v@samsung.com> - 2017-01-30 06:00 +0100 Re: [PATCH] Gpu: drm: tegra - Fix possible NULL derefrence. Thierry Reding <thierry.reding@gmail.com> - 2017-01-30 08:20 +0100
csiph-web