Re: [Bluez-devel] Oops involving RFCOMM and sysfs

Cornelia Huck
2008-01-09T15:58:31Z

On Wed, 09 Jan 2008 18:16:02 +0900,
Tejun Heo <htejun@gmail.com> wrote:

> This isn't supported. sysfs doesn't allow parents to die first and the
> dangling children to be salvaged using sysfs_move().

But (with the sysfs bugs fixed) it will return an error, won't it? It
seems the bluetooth code is rather optimistic with never checking
device_move()'s return code.

>
> 2. Which in turn exposes three bugs in sysfs
> - sysfs_lookup() returning NULL on negative lookup. sysfs
> code requires that all negative dentries are shot down.
> lookup should return -ENOENT instead of NULL.
> - in move and rename, error handling is wrong. It ends up
> passing ERR_PTR() values to dput().
> - there was an extra dput() in sysfs_move_dir().

Ups, seem to have copied that from some old version of
sysfs_rename_dir()...

>
> The attached patch fixes all sysfs bugs and removes the oops.

Looks OK at first glance.