drm/sti: Handle return value of platform_get_irq_byname
authorArvind Yadav <arvind.yadav.cs@gmail.com>
Fri, 17 Nov 2017 10:36:06 +0000 (16:06 +0530)
committerBenjamin Gaignard <benjamin.gaignard@linaro.org>
Tue, 21 Nov 2017 08:41:49 +0000 (09:41 +0100)
platform_get_irq_byname() can fail here and we must check its return
value.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/f4b4f1b2cfa5e302ef7ffad4e3efb0d3147709d3.1510914877.git.arvind.yadav.cs@gmail.com
drivers/gpu/drm/sti/sti_hdmi.c

index d1902750a85da6b805d758a1acbc85cb13212ccb..1c7423f4d423e90102c227aedcfaca807a933317 100644 (file)
@@ -1413,6 +1413,11 @@ static int sti_hdmi_probe(struct platform_device *pdev)
        init_waitqueue_head(&hdmi->wait_event);
 
        hdmi->irq = platform_get_irq_byname(pdev, "irq");
+       if (hdmi->irq < 0) {
+               DRM_ERROR("Cannot get HDMI irq\n");
+               ret = hdmi->irq;
+               goto release_adapter;
+       }
 
        ret = devm_request_threaded_irq(dev, hdmi->irq, hdmi_irq,
                        hdmi_irq_thread, IRQF_ONESHOT, dev_name(dev), hdmi);