[lkml]   [2006]   [Nov]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [Patch -mm 2/2] driver core: Introduce device_move(): move a device
Cornelia Huck wrote:

> + if (old_parent)
> + klist_del(&dev->knode_parent);
> + klist_add_tail(&dev->knode_parent, &new_parent->klist_children);

> + klist_del(&dev->knode_parent);
> + if (old_parent)
> + klist_add_tail(&dev->knode_parent,
> &old_parent->klist_children);

This is wrong. klist_del() does not wait for the knode to be removed from
its klist. You need to use klist_remove().

I don't see any protection against new_parent being removed while dev is
being transferred under it. Are you relying on the caller to make sure
this never happens?

Alan Stern

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2006-11-22 16:35    [W:0.031 / U:2.780 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site