From: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
To: Dongliang Mu <mudongliangabcd@gmail.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] memory: fsl_ifc: fix leak of irq and nand_irq in fsl_ifc_ctrl_probe
Date: Tue, 3 Aug 2021 11:51:19 +0200 [thread overview]
Message-ID: <d248924f-3dca-7be8-39d6-4ac746670ae4@canonical.com> (raw)
In-Reply-To: <CAD-N9QXfdossFaQFwa-DPCyY-deHZ-75=LtSQYihvPNDpzwqiw@mail.gmail.com>
On 03/08/2021 11:28, Dongliang Mu wrote:
> On Tue, Aug 3, 2021 at 3:57 PM Krzysztof Kozlowski
> <krzysztof.kozlowski@canonical.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.
>
> 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
next prev parent reply other threads:[~2021-08-03 9:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-03 7:51 Dongliang Mu
2021-08-03 7:57 ` Krzysztof Kozlowski
2021-08-03 9:28 ` Dongliang Mu
2021-08-03 9:51 ` Krzysztof Kozlowski [this message]
2021-08-03 10:55 ` Dongliang Mu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d248924f-3dca-7be8-39d6-4ac746670ae4@canonical.com \
--to=krzysztof.kozlowski@canonical.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mudongliangabcd@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®