lkml.org 
[lkml]   [2017]   [May]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 15/24] thunderbolt: Rework control channel to be more reliable
On Thu, May 25, 2017 at 03:25:46PM +0200, Greg Kroah-Hartman wrote:
> > +/**
> > + * tb_cfg_request_put() - Decrease refcount and possibly release the request
> > + * @req: Request whose refcount is decreased
> > + *
> > + * Call this function when you are done with the request. When refcount
> > + * goes to %0 the object is released.
> > + */
> > +void tb_cfg_request_put(struct tb_cfg_request *req)
> > +{
> > + kref_put(&req->kref, tb_cfg_request_destroy);
> > +}
>
> What prevents this call from being called twice on the same object from
> different threads at the same time? You still need a lock somewhere to
> protect yourself from that, am I just missing where that lock is?

No, you are right - it is missing a lock. I will add it there in the
next version.

Thanks.

\
 
 \ /
  Last update: 2017-05-25 16:36    [W:0.121 / U:7.072 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site