From ec3c6b5a11ddbe51c8550202b083c38fda597eb7 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 10 Mar 2019 04:39:05 +0000 Subject: [PATCH] scst_copy_mgr, initial inquiry: Hold a reference on struct scst_device git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8032 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_copy_mgr.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scst/src/scst_copy_mgr.c b/scst/src/scst_copy_mgr.c index 90eb25a7a..44a750126 100644 --- a/scst/src/scst_copy_mgr.c +++ b/scst/src/scst_copy_mgr.c @@ -2441,6 +2441,7 @@ out_put: scst_put_buf_full(cmd, buf); out: + percpu_ref_put(&dev->refcnt); TRACE_EXIT(); return; } @@ -2464,6 +2465,7 @@ static int scst_cm_send_init_inquiry(struct scst_device *dev, } priv->cm_init_inq_finish_fn = scst_cm_init_inq_finish; priv->dev = dev; + percpu_ref_get(&dev->refcnt); } lun = scst_pack_lun(unpacked_lun, scst_cm_sess->acg->addr_method);