Skip to content

Commit bc04d76

Browse files
hfvogtgregkh
authored andcommitted
w1 - call request_module with w1 master mutex unlocked
request_module for w1 slave modules needs to be called with the w1 master mutex unlocked. Because w1_attach_slave_device gets always(?) called with mutex locked, we need to temporarily unlock the w1 master mutex for the loading of the w1 slave module. Signed-off by: Hans-Frieder Vogt <[email protected]> Acked-by: Evgeniy Polyakov <[email protected]> Cc: stable <[email protected]> # 3.11+ Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 2962aec commit bc04d76

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/w1/w1.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,10 @@ static int w1_attach_slave_device(struct w1_master *dev, struct w1_reg_num *rn)
716716
atomic_set(&sl->refcnt, 0);
717717
init_completion(&sl->released);
718718

719+
/* slave modules need to be loaded in a context with unlocked mutex */
720+
mutex_unlock(&dev->mutex);
719721
request_module("w1-family-0x%0x", rn->family);
722+
mutex_lock(&dev->mutex);
720723

721724
spin_lock(&w1_flock);
722725
f = w1_family_registered(rn->family);

0 commit comments

Comments
 (0)