• Tejun Heo's avatar
    [PATCH] driver-model: bus_recan_devices() locking fix · fa39fa6b
    Tejun Heo authored
     df_02_bus_rescan_devcies_fix.patch
    
     bus_rescan_devices() eventually calls device_attach() and thus
    requires write locking the corresponding bus.  The original code just
    called bus_for_each_dev() which only read locks the bus.  This patch
    separates __bus_for_each_dev() and __bus_for_each_drv(), which don't
    do locking themselves, out from the original functions and call them
    with read lock in the original functions and with write lock in
    bus_rescan_devices().
    Signed-off-by: default avatarTejun Heo <tj@home-tj.org>
    Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
    fa39fa6b
bus.c 17.9 KB