mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] usb: misc: eud: Add IRQ check for platform_get_irq()
@ 2023-11-02  7:51 Chen Ni
  2023-11-02 16:06 ` Caleb Connolly
  0 siblings, 1 reply; 2+ messages in thread
From: Chen Ni @ 2023-11-02  7:51 UTC (permalink / raw)
  To: agross, andersson, konrad.dybcio, quic_schowdhu, gregkh
  Cc: linux-arm-msm, linux-usb, linux-kernel, Chen Ni

The function eud_probe() should check the return value of
platform_get_irq() for errors so as to not pass a negative value to
the devm_request_threaded_irq().

Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
---
 drivers/usb/misc/qcom_eud.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/usb/misc/qcom_eud.c b/drivers/usb/misc/qcom_eud.c
index 7f371ea1248c..26e9b8749d8a 100644
--- a/drivers/usb/misc/qcom_eud.c
+++ b/drivers/usb/misc/qcom_eud.c
@@ -205,6 +205,9 @@ static int eud_probe(struct platform_device *pdev)
 		return PTR_ERR(chip->mode_mgr);
 
 	chip->irq = platform_get_irq(pdev, 0);
+	if (chip->irq < 0)
+		return chip->irq;
+
 	ret = devm_request_threaded_irq(&pdev->dev, chip->irq, handle_eud_irq,
 			handle_eud_irq_thread, IRQF_ONESHOT, NULL, chip);
 	if (ret)
-- 
2.25.1


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

* Re: [PATCH] usb: misc: eud: Add IRQ check for platform_get_irq()
  2023-11-02  7:51 [PATCH] usb: misc: eud: Add IRQ check for platform_get_irq() Chen Ni
@ 2023-11-02 16:06 ` Caleb Connolly
  0 siblings, 0 replies; 2+ messages in thread
From: Caleb Connolly @ 2023-11-02 16:06 UTC (permalink / raw)
  To: Chen Ni, agross, andersson, konrad.dybcio, quic_schowdhu, gregkh
  Cc: linux-arm-msm, linux-usb, linux-kernel



On 02/11/2023 07:51, Chen Ni wrote:
> The function eud_probe() should check the return value of
> platform_get_irq() for errors so as to not pass a negative value to
> the devm_request_threaded_irq().
> 
> Signed-off-by: Chen Ni <nichen@iscas.ac.cn>

Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
> ---
>   drivers/usb/misc/qcom_eud.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/usb/misc/qcom_eud.c b/drivers/usb/misc/qcom_eud.c
> index 7f371ea1248c..26e9b8749d8a 100644
> --- a/drivers/usb/misc/qcom_eud.c
> +++ b/drivers/usb/misc/qcom_eud.c
> @@ -205,6 +205,9 @@ static int eud_probe(struct platform_device *pdev)
>   		return PTR_ERR(chip->mode_mgr);
>   
>   	chip->irq = platform_get_irq(pdev, 0);
> +	if (chip->irq < 0)
> +		return chip->irq;
> +
>   	ret = devm_request_threaded_irq(&pdev->dev, chip->irq, handle_eud_irq,
>   			handle_eud_irq_thread, IRQF_ONESHOT, NULL, chip);
>   	if (ret)

-- 
// Caleb (they/them)

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

end of thread, other threads:[~2023-11-02 16:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-02  7:51 [PATCH] usb: misc: eud: Add IRQ check for platform_get_irq() Chen Ni
2023-11-02 16:06 ` Caleb Connolly

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®