[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAD-N9QVAR0PCo=5aokYuSNg=W5XwcvWQQxCjPrMj240EDN=zKg@mail.gmail.com>
Date: Tue, 3 Aug 2021 18:55:27 +0800
From: Dongliang Mu <mudongliangabcd@...il.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@...onical.com>
Cc: linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] memory: fsl_ifc: fix leak of irq and nand_irq in fsl_ifc_ctrl_probe
On Tue, Aug 3, 2021 at 5:51 PM Krzysztof Kozlowski
<krzysztof.kozlowski@...onical.com> wrote:
>
> On 03/08/2021 11:28, Dongliang Mu wrote:
> > On Tue, Aug 3, 2021 at 3:57 PM Krzysztof Kozlowski
> > <krzysztof.kozlowski@...onical.com> wrote:
> >>
> >> On 03/08/2021 09:51, Dongliang Mu wrote:
> >>> In fsl_ifc_ctrl_probe, if fsl_ifc_ctrl_init fails, we should free the
> >>> resources allocated by irq_of_parse_and_map.
> >>
> >> Your code is doing much more. You also touch nand_irq, not only
> >> fsl_ifc_ctrl_init(). This looks incorrect as IRQ is optional, isn't it?
> >>
> >> The problem is entirely different than you described here - the error
> >> paths of fsl_ifc_ctrl_init() and request_irq() are wrong. They do not
> >> release resources in proper paths.
> >
> > Yes, you're right :). This patch rewrites the whole error handling
> > code. Any comment on the code changes?
>
> I did not check the exact error paths, I assume you are going to make
> them correct. Therefore only the nand_irq which looks optional and your
> code makes it required.
Well, yes. It seems unnecessary. I will revert this part of the code
changes and send a v2 patch.
>
> >
> > I will rewrite the commit message in the patch v2.
> >
> > BTW, there is a minor issue: if request_irq fails, we should not
> > invoke free_irq.
> >
>
>
> Best regards,
> Krzysztof
Powered by blists - more mailing lists