mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm/sti: Handle return value of platform_get_irq_byname
@ 2017-11-17 10:36 Arvind Yadav
  2017-11-21  9:14 ` Benjamin Gaignard
  0 siblings, 1 reply; 2+ messages in thread
From: Arvind Yadav @ 2017-11-17 10:36 UTC (permalink / raw)
  To: benjamin.gaignard, vincent.abriou, airlied; +Cc: linux-kernel, dri-devel

platform_get_irq_byname() can fail here and we must check its return
value.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/gpu/drm/sti/sti_hdmi.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c
index 30f02d2..adabd41 100644
--- a/drivers/gpu/drm/sti/sti_hdmi.c
+++ b/drivers/gpu/drm/sti/sti_hdmi.c
@@ -1414,6 +1414,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);
-- 
2.7.4

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/sti: Handle return value of platform_get_irq_byname
  2017-11-17 10:36 [PATCH] drm/sti: Handle return value of platform_get_irq_byname Arvind Yadav
@ 2017-11-21  9:14 ` Benjamin Gaignard
  0 siblings, 0 replies; 2+ messages in thread
From: Benjamin Gaignard @ 2017-11-21  9:14 UTC (permalink / raw)
  To: Arvind Yadav
  Cc: Vincent Abriou, David Airlie, Linux Kernel Mailing List, dri-devel

2017-11-17 11:36 GMT+01:00 Arvind Yadav <arvind.yadav.cs@gmail.com>:
> platform_get_irq_byname() can fail here and we must check its return
> value.
>

Applied on drm-misc-next.

Thanks,
Benjamin

> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> ---
>  drivers/gpu/drm/sti/sti_hdmi.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c
> index 30f02d2..adabd41 100644
> --- a/drivers/gpu/drm/sti/sti_hdmi.c
> +++ b/drivers/gpu/drm/sti/sti_hdmi.c
> @@ -1414,6 +1414,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);
> --
> 2.7.4
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-11-21  9:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-17 10:36 [PATCH] drm/sti: Handle return value of platform_get_irq_byname Arvind Yadav
2017-11-21  9:14 ` Benjamin Gaignard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®