From: Sebastian Ott Date: Tue, 12 Apr 2011 17:05:37 +0000 (+0200) Subject: driver-core: fix race between device_register and driver_register X-Git-Tag: v3.0-rc1~390^2~28 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8497d6a21c4b17052e868bd53a74c82b557a6c46;p=pandora-kernel.git driver-core: fix race between device_register and driver_register When a device is registered to a bus it will be a) added to the list of devices of the bus and b) bind to a driver (if one matches). As a result of a driver being registered at this bus between a) and b) this device could already be bound to a driver. This leads to a warning and incorrect refcounting. To fix this add a check to device_attach to identify an already bound device. Signed-off-by: Sebastian Ott Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed