All of lore.kernel.org
 help / color / mirror / Atom feed
From: zwp10758@gmail.com (Weiping Zhang)
Subject: [PATCH 2/2] nvme-pci: release nvme_ctrl if failed to alloc memory in nvme_probe
Date: Tue, 3 Jul 2018 00:13:35 +0800	[thread overview]
Message-ID: <CAA70yB5B29czbcAfGpkAB9LwzbWj4X3uVfh_4KeQ4qCyGF_acw@mail.gmail.com> (raw)
In-Reply-To: <ae68b07d-9b30-a85e-61e5-b76f4e1a2937@grimberg.me>

Sagi Grimberg <sagi at grimberg.me> ?2018?7?2??? ??5:54???
>
>
> > +release_ctrl:
> > +     nvme_uninit_ctrl(&dev->ctrl);
> > +     nvme_put_ctrl(&dev->ctrl);
>
> Hmm, put_ctrl would trigger nvme_pci_free_ctrl which will
> do some of what you fallthru down here, won't that cause
> double free/put?
>
You are right, I plan to move all this cleanup to nvme_pci_ctrl_free,
If failed before call nvme_init_ctrl, do cleanup by these goto.
if failed after call nvme_init_ctrl, direct use nvme_put_ctrl to release
all these resource.

I'll send V2.
> >   release_pools:
> >       nvme_release_prp_pools(dev);
> >   unmap:
> >
>
> _______________________________________________
> Linux-nvme mailing list
> Linux-nvme at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-nvme

      reply	other threads:[~2018-07-02 16:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-01 15:20 [PATCH 0/2] release /dev/nvmeX if nvme_probe failed Weiping Zhang
2018-07-01 15:20 ` [PATCH 1/2] nvme-pci: remove whitespace Weiping Zhang
2018-07-02  9:49   ` Sagi Grimberg
2018-07-02 13:07   ` Christoph Hellwig
2018-07-02 15:45   ` Keith Busch
2018-07-02 16:10     ` Weiping Zhang
2018-07-01 15:20 ` [PATCH 2/2] nvme-pci: release nvme_ctrl if failed to alloc memory in nvme_probe Weiping Zhang
2018-07-02  9:53   ` Sagi Grimberg
2018-07-02 16:13     ` Weiping Zhang [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=CAA70yB5B29czbcAfGpkAB9LwzbWj4X3uVfh_4KeQ4qCyGF_acw@mail.gmail.com \
    --to=zwp10758@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.