mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-17 10:41:26 +00:00
fcst: Fix a race condition
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4961 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -216,7 +216,8 @@ static struct ft_sess *ft_sess_get(struct fc_lport *lport, u32 port_id)
|
||||
hlist_for_each_entry_rcu(sess, head, hash) {
|
||||
#endif
|
||||
if (sess->port_id == port_id) {
|
||||
kref_get(&sess->kref);
|
||||
if (!kref_get_unless_zero(&sess->kref))
|
||||
sess = NULL;
|
||||
rcu_read_unlock();
|
||||
FT_SESS_DBG("port_id %x found %p\n", port_id, sess);
|
||||
return sess;
|
||||
|
||||
Reference in New Issue
Block a user