Re: [PATCH v3 1/2] usb: chipidea: ci_hdrc_imx: Propagate errors from optional IRQ lookup
Bui Duc Phuc <[email protected]>
| Newsgroups | dev.linux.lists.sashiko-reviews,dev.linux.lists.imx |
|---|---|
| Message-ID | <CAABR9nH3qTfRbsT2aE228M-koP0mNdmHy48ti1-xSkKHQcC7pw@mail.gmail.com> |
> [Severity: High]
> This is a pre-existing issue, but missing an assignment to ret here causes
> the probe to falsely succeed:
>
> drivers/usb/chipidea/ci_hdrc_imx.c:ci_hdrc_imx_probe() {
> ...
> if (data->wakeup_irq > 0) {
> irq_name = devm_kasprintf(dev, GFP_KERNEL, "%s:wakeup", pdata.name);
> if (!irq_name) {
> dev_err_probe(dev, -ENOMEM, "failed to create irq_name\n");
> goto err_clk;
> }
> ...
> }
>
> Because dev_err_probe() is called but its return value is not assigned to
> ret, and ret is 0 at this point, the probe function incorrectly returns 0
> (success) despite the memory allocation failure.
>
> Does this code need to assign the error to ret before jumping to err_clk?
This issue has been addressed in patch 2:
[PATCH v3 2/2] usb: chipidea: ci_hdrc_imx: Fix error handling when
creating IRQ name