From: Alex Chiang <achiang@hp.com>
To: Rakib Mullick <rakib.mullick@gmail.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>,
linux-pci@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] pci: Make pci_dev struct point to NULL.
Date: Fri, 4 Dec 2009 21:36:35 -0700 [thread overview]
Message-ID: <20091205043635.GA10777@ldl.fc.hp.com> (raw)
In-Reply-To: <b9df5fa10912041753n27e60020x2dd41eb50f4608ff@mail.gmail.com>
* Rakib Mullick <rakib.mullick@gmail.com>:
> On 12/5/09, Alex Chiang <achiang@hp.com> wrote:
> > * Rakib Mullick <rakib.mullick@gmail.com>:
> >
> > This is from Linus's latest tree:
> >
> > 974
> > 975 if (slot->flags & SLOT_ENABLED)
> > 976 goto err_exit;
>
> I'm talking about this line. From here we can hit 'goto err_exit' without
> using pci_get_slot.
Right, so what's the problem? If the slot is not enabled, we goto
err_exit and return, never touching dev.
> > 977
> > 978 /* sanity check: dev should be NULL when hot-plugged in */
> > 979 dev = pci_get_slot(bus, PCI_DEVFN(slot->device, 0));
> > 980 if (dev) {
> >
> > I assume your line 975 is my line 980.
>
> Nope, my line 975 is also yours.
> >
> > pci_get_slot() returns NULL if it doesn't find the devfn, so as
> > far as I can tell, there's no need to initialize dev to NULL.
> >
> > Were you fixing a real bug with this patch? Did you actually get
> > the "pci_dev structure already exists.\n" error message?
> >
> No - i'm trying to make sure that we're not referencing into a trash.
I must be slow, because I don't understand how we might reference
trash.
Care to explain it to me?
Thanks,
/ac
next prev parent reply other threads:[~2009-12-05 4:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-04 16:35 [PATCH] pci: Make pci_dev struct point to NULL Rakib Mullick
2009-12-04 20:27 ` Alex Chiang
2009-12-05 1:53 ` Rakib Mullick
2009-12-05 4:36 ` Alex Chiang [this message]
2009-12-05 4:37 ` Alex Chiang
2009-12-05 5:18 ` Rakib Mullick
2009-12-05 5:28 ` Alex Chiang
2009-12-05 5:47 ` Rakib Mullick
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=20091205043635.GA10777@ldl.fc.hp.com \
--to=achiang@hp.com \
--cc=akpm@linux-foundation.org \
--cc=jbarnes@virtuousgeek.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=rakib.mullick@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.