From: Frank Pavlic Date: Sun, 27 Nov 2005 04:48:40 +0000 (-0800) Subject: [PATCH] klist: Fix broken kref counting in find functions X-Git-Tag: v2.6.16-rc1~474^2~22^2^2~12 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e22dafbcd7a579c29a424d5203b5b33b131948a7;p=pandora-kernel.git [PATCH] klist: Fix broken kref counting in find functions The klist reference counting in the find functions that use klist_iter_init_node is broken. If the function (for example driver_find_device) is called with a NULL start object then everything is fine, the first call to next_device()/klist_next increases the ref-count of the first node on the list and does nothing for the start object which is NULL. If they are called with a valid start object then klist_next will decrement the ref-count for the start object but nobody has incremented it. Logical place to fix this would be klist_iter_init_node because the function puts a reference of the object into the klist_iter struct. Signed-off-by: Martin Schwidefsky Signed-off-by: Frank Pavlic Cc: Patrick Mochel Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed