Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: misc: eud: Add IRQ check for platform_get_irq()

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>
Link: https://lore.kernel.org/r/20231102075113.1043358-1-nichen@iscas.ac.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Chen Ni and committed by
Greg Kroah-Hartman
6437760a d990e227

+3
+3
drivers/usb/misc/qcom_eud.c
··· 205 205 return PTR_ERR(chip->mode_mgr); 206 206 207 207 chip->irq = platform_get_irq(pdev, 0); 208 + if (chip->irq < 0) 209 + return chip->irq; 210 + 208 211 ret = devm_request_threaded_irq(&pdev->dev, chip->irq, handle_eud_irq, 209 212 handle_eud_irq_thread, IRQF_ONESHOT, NULL, chip); 210 213 if (ret)