drm/exynos: hdmi: Fix potential NULL pointer dereference error
authorSachin Kamat <sachin.kamat@linaro.org>
Wed, 12 Dec 2012 08:54:08 +0000 (14:24 +0530)
committerInki Dae <inki.dae@samsung.com>
Fri, 14 Dec 2012 06:40:50 +0000 (15:40 +0900)
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>
drivers/gpu/drm/exynos/exynos_hdmi.c

index e009216e4a3c6004ed57eb6ef4adf55249c583d4..2c46b6c0b82cf991e1a489c98389566ea5ae6f8a 100644 (file)
@@ -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