From: David Miller <davem@davemloft.net>
To: baijiaju1990@gmail.com
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: via-rhine: net: Fix a resource leak in rhine_init()
Date: Fri, 03 May 2019 23:41:31 -0400 (EDT) [thread overview]
Message-ID: <20190503.234131.1909607319842703379.davem@davemloft.net> (raw)
In-Reply-To: <f2e7c284-aa70-2b67-b9dd-461db102cbc5@gmail.com>
From: Jia-Ju Bai <baijiaju1990@gmail.com>
Date: Sat, 4 May 2019 11:23:06 +0800
>
>
> On 2019/5/4 11:13, David Miller wrote:
>> From: Jia-Ju Bai <baijiaju1990@gmail.com>
>> Date: Sat, 4 May 2019 11:08:13 +0800
>>
>>> When platform_driver_register() fails, pci_unregister_driver() is not
>>> called to release the resource allocated by pci_register_driver().
>>>
>>> To fix this bug, error handling code for platform_driver_register()
>>> and
>>> pci_register_driver() is separately implemented.
>>>
>>> This bug is found by a runtime fuzzing tool named FIZZER written by
>>> us.
>>>
>>> Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
>> I think the idea here is that PCI is not enabled in the kernel, it is
>> fine for the pci register to fail and only the platform register to
>> succeed.
>>
>> You are breaking that.
>
> Okay, I can understand it.
> If so, I think that platform_driver_register() should be called before
> pci_register_driver(), and it is still necessary to separately handle
> their errors.
> If you agree, I will send a v2 patch.
It is only a failure if both fail.
If at least one succeeds, the driver can potentially probe properly.
next prev parent reply other threads:[~2019-05-04 3:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-04 3:08 Jia-Ju Bai
2019-05-04 3:13 ` David Miller
2019-05-04 3:23 ` Jia-Ju Bai
2019-05-04 3:41 ` David Miller [this message]
2019-05-04 3:57 ` Jia-Ju Bai
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=20190503.234131.1909607319842703379.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=baijiaju1990@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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®