summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSachin Kamat2012-12-12 09:54:08 +0100
committerInki Dae2012-12-14 07:40:50 +0100
commit1a4513b344fe1361ccb4936cf2c0526693297c33 (patch)
treefe353387de00df5493d3ac7fba967e27977e7dc3
parentdrm/exynos: hdmi: Add CONFIG_OF and use of_match_ptr() macro (diff)
downloadkernel-qcow2-linux-1a4513b344fe1361ccb4936cf2c0526693297c33.tar.gz
kernel-qcow2-linux-1a4513b344fe1361ccb4936cf2c0526693297c33.tar.xz
kernel-qcow2-linux-1a4513b344fe1361ccb4936cf2c0526693297c33.zip
drm/exynos: hdmi: Fix potential NULL pointer dereference error
This is an unlikely case. However to silence the following smatch error add a NULL check: drivers/gpu/drm/exynos/exynos_hdmi.c:2486 hdmi_probe() error: potential NULL dereference 'match'. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Inki Dae <inki.dae@samsung.com>
-rw-r--r--drivers/gpu/drm/exynos/exynos_hdmi.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
index e009216e4a3c..2c46b6c0b82c 100644
--- a/drivers/gpu/drm/exynos/exynos_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
@@ -2502,6 +2502,8 @@ static int __devinit hdmi_probe(struct platform_device *pdev)
const struct of_device_id *match;
match = of_match_node(of_match_ptr(hdmi_match_types),
pdev->dev.of_node);
+ if (match == NULL)
+ return -ENODEV;
hdata->type = (enum hdmi_type)match->data;
} else {
hdata->type = (enum hdmi_type)platform_get_device_id