Re: [PATCH] dmaengine: qcom_hidma: Simplify error handling path in hidma_probe
From: Dan Carpenter
Date: Tue Apr 28 2020 - 13:23:46 EST
I apologize, I wrote my code hurriedly and did no explain the bug well.
I understood what the code is doing, but my fix was missing an if
condition.
On Tue, Apr 28, 2020 at 12:01:15PM -0400, Sinan Kaya wrote:
> On 4/28/2020 8:54 AM, Dan Carpenter wrote:
> >> @@ -897,7 +897,6 @@ static int hidma_probe(struct platform_device *pdev)
> >> if (msi)
> > ^^^
> > This test doesn't work. It will call free hidma_free_msis() if the
> > hidma_request_msi() call fails. We should do:
> >
> > if (msi) {
> > rc = hidma_request_msi(dmadev, pdev);
> > msi = false;
What I meant to say here was:
if (msi) {
rc = hidma_request_msi(dmadev, pdev);
if (rc)
msi = false;
Otherwise we end up checking freeing the msi in the error handling
code when we did not take it.
Hopefully, that clears things up?
regards,
dan carpenter