lkml.org 
[lkml]   [2022]   [Nov]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/1] usb: gadget: f_hid: Conduct proper refcounting on shared f_hidg pointer
On Fri, Nov 18, 2022 at 04:37:32PM +0000, John Keeping wrote:
> I don't think it's at all simple to fix this - I posted a series
> addressing the lifetime issues here a few years ago but didn't chase it
> up and there was no feedback:
>
> https://lore.kernel.org/linux-usb/20191028114228.3679219-1-john@metanate.com/
>
> That includes a patch to remove the embedded struct cdev and manage its
> lifetime separately, which I think is needed as there are two different
> struct device objects here and we cannot tie their lifetimes together.

I still don't have a clear picture of what the real problem is. Lee's
original patch description just said "external references are presently
not tracked", with no details about what those external references are.
Why not add just proper cdev_get() and cdev_put() calls to whatever code
handles those external references, so that they _are_ tracked?

What are the two different struct device objects? Why do their
lifetimes need to be tied together? If you do need to tie their
lifetimes somehow, why not simply make one of them (the one which is
logically allowed to be shorter-lived) hold a reference to the other?

Alan Stern

\
 
 \ /
  Last update: 2022-11-18 22:08    [W:0.480 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site