lkml.org 
[lkml]   [2003]   [Jun]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Flaw in the driver-model implementation of attributes
On Mon, Jun 16, 2003 at 01:54:34PM -0400, Alan Stern wrote:

> > IMO, if you don't own the object (and therefore don't know its lifetime),
> > you shouldn't be adding sysfs or device model attributes of any kind to
> > that object.
>
> That's not practical. How else can a device driver provide
> device-specific configuration options or information in sysfs? In many
> cases the device is owned by the bus, not the device driver.

Practical or not, when you put sysfs object into a structure, you take
full responsibility for the lifetime of that structure. Period.

Note that problems exist even when kernel is non-modular. Even if code
stays in place, the data getting freed under you is just as bad. And
that can trivially happen without any modules.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:36    [W:0.170 / U:0.520 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site