[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAAW3YpYQcn-=eU+UTst1u7oKpW2k8R9Yvd-8i91hCaRGySUHiQ@mail.gmail.com>
Date: Mon, 30 Jul 2018 23:29:37 -0700
From: Todd Poynor <toddpoynor@...gle.com>
To: Dmitry Torokhov <dtor@...omium.org>
Cc: "toddpoynor@...il.com" <toddpoynor@...il.com>,
Rob Springer <rspringer@...gle.com>,
John Joseph <jnjoseph@...gle.com>, benchan@...omium.org,
Greg KH <gregkh@...uxfoundation.org>,
devel@...verdev.osuosl.org, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 01/13] staging: gasket: core: hold reference to pci_dev
while used
On Mon, Jul 30, 2018 at 11:19 PM Dmitry Torokhov <dtor@...omium.org> wrote:
>
> On Sun, Jul 29, 2018 at 12:37 PM Todd Poynor <toddpoynor@...il.com> wrote:
> >
> > From: Todd Poynor <toddpoynor@...gle.com>
> >
> > Hold a reference on the struct pci_dev while a pointer to it is held in
> > the gasket data structures.
> >
> > Signed-off-by: Todd Poynor <toddpoynor@...gle.com>
> > ---
> > drivers/staging/gasket/gasket_core.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/staging/gasket/gasket_core.c b/drivers/staging/gasket/gasket_core.c
> > index 2b484d067c38a..b832a4f529f27 100644
> > --- a/drivers/staging/gasket/gasket_core.c
> > +++ b/drivers/staging/gasket/gasket_core.c
> > @@ -488,6 +488,7 @@ static void gasket_free_dev(struct gasket_dev *gasket_dev)
> > internal_desc->devs[gasket_dev->dev_idx] = NULL;
> > mutex_unlock(&internal_desc->mutex);
> > put_device(gasket_dev->dev);
> > + pci_dev_put(gasket_dev->pci_dev);
>
> gasket_free_dev() is called only from driver PCI probe and remove
> function. I can assure you that that pci_dev structure is not going
> anywhere, there is no need to take this additional reference.
WIll fix, thanks.
>
> Thanks,
> Dmitry
Powered by blists - more mailing lists