From: Dave Young Date: Sat, 14 Feb 2009 13:23:22 +0000 (+0800) Subject: driver-core: do not register a driver with bus_type not registered X-Git-Tag: v2.6.30-rc1~671^2~21 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f48f3febb2cbfd0f2ecee7690835ba745c1034a4;p=pandora-kernel.git driver-core: do not register a driver with bus_type not registered If the bus_type is not registerd, driver_register to that bus will cause oops. I found this bug when test built-in usb serial drivers (ie. aircable driver) with 'nousb' cmdline params. In this patch: 1. set the bus->p=NULL when bus_register failed and unregisterd. 2. if bus->p is NULL, driver_register BUG_ON will be triggered. Signed-off-by: Dave Young Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed