mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: [Patch -mm 2/2] driver core: Introduce device_move(): move a device
@ 2006-11-22 15:32 Alan Stern
  2006-11-22 16:45 ` Cornelia Huck
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Stern @ 2006-11-22 15:32 UTC (permalink / raw)
  To: Cornelia Huck; +Cc: Kernel development list

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-11-22 17:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-22 15:32 [Patch -mm 2/2] driver core: Introduce device_move(): move a device Alan Stern
2006-11-22 16:45 ` Cornelia Huck
2006-11-22 16:49   ` [Patch -mm] driver core: Use klist_remove() in device_move() Cornelia Huck
2006-11-22 17:37   ` [Patch -mm 2/2] driver core: Introduce device_move(): move a device Alan Stern

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®