Skip to content
Commit 63673597 authored by Karsten Graul's avatar Karsten Graul Committed by David S. Miller
Browse files

net/smc: protect smc ib device initialization



Before an smc ib device is used the first time for an smc link it is
lazily initialized. When there are 2 active link groups and a new ib
device is brought online then it might happen that 2 link creations run
in parallel and enter smc_ib_setup_per_ibdev(). Both allocate new send
and receive completion queues on the device, but only one set of them
keeps assigned and the other leaks.
Fix that by protecting the setup and cleanup code using a mutex.

Reviewed-by: default avatarUrsula Braun <ubraun@linux.ibm.com>
Fixes: f3c1dedd ("net/smc: separate function for link initialization")
Signed-off-by: default avatarKarsten Graul <kgraul@linux.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7df8bcb5
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment