From: Zheyu Ma <zheyuma97@gmail.com>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: scott@spiteful.org, Bjorn Helgaas <bhelgaas@google.com>,
linux-pci@vger.kernel.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Tong Zhang <ztong0001@gmail.com>
Subject: Re: [PATCH] PCI: hotplug: set 'thread_finished' flag to be true by default
Date: Mon, 5 Jul 2021 13:13:42 +0800 [thread overview]
Message-ID: <CAMhUBj=FKcox+EkFtJm=LVWyBwDHd1SSQLwnKbFc6Nu1t0uUYA@mail.gmail.com> (raw)
In-Reply-To: <20210701223407.GA104070@bjorn-Precision-5520>
On Fri, Jul 2, 2021 at 6:34 AM Bjorn Helgaas <helgaas@kernel.org> wrote:
>
> [+cc Tong]
>
> On Thu, Jun 10, 2021 at 03:02:41AM +0000, Zheyu Ma wrote:
> > In the process of probing the driver 'cpcihp_zt5550', function
> > 'pci_get_device' may fail, at this time 'cpci_hp_unregister_controller'
> > will be called. Since the default value of 'thread_finished' is 0,
> > 'cpci_stop_thread' will be executed, but at this time 'cpci_thread' has
> > not been allocated, which leads to a null pointer dereference.
>
> This looks like the same problem Tong reported here:
>
> https://lore.kernel.org/r/20210321055109.322496-1-ztong0001@gmail.com
>
> I responded to Tong in that thread, and my response to this patch is
> basically the same: I think "thread_finished" is a hack and we can do
> better.
OK, I will reconsider the patch and send the next version to you.
> > Fix this by set 'thread_finished' to be true by default.
> >
> > This log reveals it:
>
> It's good to have the essential details from the log, but most of this
> is not relevant to the problem and should be omitted.
Thanks for your advice, I will delete it in the next patch.
Regards,
Zheyu Ma
prev parent reply other threads:[~2021-07-05 5:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-10 3:02 [PATCH] PCI: hotplug: set 'thread_finished' flag to be true by default Zheyu Ma
2021-07-01 22:34 ` Bjorn Helgaas
2021-07-05 5:13 ` Zheyu Ma [this message]
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='CAMhUBj=FKcox+EkFtJm=LVWyBwDHd1SSQLwnKbFc6Nu1t0uUYA@mail.gmail.com' \
--to=zheyuma97@gmail.com \
--cc=bhelgaas@google.com \
--cc=helgaas@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=scott@spiteful.org \
--cc=ztong0001@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;
as well as URLs for NNTP newsgroup(s).