mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-17 18:51:27 +00:00
scst, tgt_dev: Hold a reference on struct scst_device
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8034 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -5470,6 +5470,8 @@ static int scst_alloc_add_tgt_dev(struct scst_session *sess,
|
||||
|
||||
*out_tgt_dev = tgt_dev;
|
||||
|
||||
percpu_ref_get(&dev->refcnt);
|
||||
|
||||
out:
|
||||
TRACE_EXIT_RES(res);
|
||||
return res;
|
||||
@@ -5572,6 +5574,8 @@ static void scst_free_tgt_dev(struct scst_tgt_dev *tgt_dev)
|
||||
|
||||
kmem_cache_free(scst_tgtd_cachep, tgt_dev);
|
||||
|
||||
percpu_ref_put(&dev->refcnt);
|
||||
|
||||
TRACE_EXIT();
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user