mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-28 09:20:18 +00:00
scst, acg_dev: Hold a reference on struct scst_device
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8033 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -4344,6 +4344,8 @@ static struct scst_acg_dev *scst_alloc_acg_dev(struct scst_acg *acg,
|
||||
res->acg = acg;
|
||||
res->lun = lun;
|
||||
|
||||
percpu_ref_get(&dev->refcnt);
|
||||
|
||||
out:
|
||||
TRACE_EXIT_HRES(res);
|
||||
return res;
|
||||
@@ -4374,6 +4376,7 @@ static void scst_del_acg_dev(struct scst_acg_dev *acg_dev,
|
||||
*/
|
||||
static void scst_free_acg_dev(struct scst_acg_dev *acg_dev)
|
||||
{
|
||||
percpu_ref_put(&acg_dev->dev->refcnt);
|
||||
kmem_cache_free(scst_acgd_cachep, acg_dev);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user