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:
Bart Van Assche
2019-03-10 04:40:49 +00:00
parent ec3c6b5a11
commit e161c14a57

View File

@@ -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);
}