lkml.org 
[lkml]   [2018]   [Jul]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 01/10] staging: gasket: save struct device for a gasket device
On Fri, Jul 27, 2018 at 8:09 AM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> On Thu, Jul 26, 2018 at 08:07:28PM -0700, Todd Poynor wrote:
> > From: Todd Poynor <toddpoynor@google.com>
> >
> > Save the struct device pointer to a gasket device in gasket's metadata,
> > to facilitate use of standard logging calls and in anticipation of
> > non-PCI gasket devices in the future.
> >
> > Signed-off-by: Todd Poynor <toddpoynor@google.com>
> > ---
> > drivers/staging/gasket/gasket_core.c | 5 +++--
> > drivers/staging/gasket/gasket_core.h | 3 +++
> > 2 files changed, 6 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/staging/gasket/gasket_core.c b/drivers/staging/gasket/gasket_core.c
> > index 732218773c3c6..e8f3b021c20d1 100644
> > --- a/drivers/staging/gasket/gasket_core.c
> > +++ b/drivers/staging/gasket/gasket_core.c
> > @@ -450,6 +450,7 @@ static int gasket_alloc_dev(
> > gasket_dev->internal_desc = internal_desc;
> > gasket_dev->dev_idx = dev_idx;
> > snprintf(gasket_dev->kobj_name, GASKET_NAME_MAX, "%s", kobj_name);
> > + gasket_dev->dev = parent;
>
> Normally when saving off a pointer to an object that you reference later
> on, and that you rely on, you need to grab a reference to it, otherwise
> it may disappear at any point in time.

Got it, I'll clean that up next round, thanks.

>
> However this whole "wrap the pci layer" nonsense is a total mess with
> the lifetime rules of devices, so it's probably the least of your
> worries....

That's high on the list to fix up, too.

>
> As long as you know you will have to fix that crud up, and what you are
> doing here will bite you if you do not do it right, that's fine with
> me...
>
> thanks,
>
> greg k-h

\
 
 \ /
  Last update: 2018-07-27 19:03    [W:0.050 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site