Do not call BUS_DRIVER_ADDED() for detached buses (attach failed) on

driver load. This fixes crash on atapicam module load on systems,
where some ata channels (usually ata1) was probed, but failed to attach.

Reviewed by:	jhb, imp
Tested by:	many
This commit is contained in:
Alexander Motin 2009-09-24 17:03:32 +00:00
parent 839dd22afd
commit 6090db7d38

View File

@ -1017,7 +1017,7 @@ devclass_driver_added(devclass_t dc, driver_t *driver)
* Call BUS_DRIVER_ADDED for any existing busses in this class.
*/
for (i = 0; i < dc->maxunit; i++)
if (dc->devices[i])
if (dc->devices[i] && device_is_attached(dc->devices[i]))
BUS_DRIVER_ADDED(dc->devices[i], driver);
/*