aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/cxlflash/superpipe.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/cxlflash/superpipe.c')
-rw-r--r--drivers/scsi/cxlflash/superpipe.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/scsi/cxlflash/superpipe.c b/drivers/scsi/cxlflash/superpipe.c
index c91fe6fe8d08..9636970d9611 100644
--- a/drivers/scsi/cxlflash/superpipe.c
+++ b/drivers/scsi/cxlflash/superpipe.c
@@ -912,7 +912,8 @@ static int _cxlflash_disk_detach(struct scsi_device *sdev,
* Release the context reference and the sdev reference that
* bound this LUN to the context.
*/
- put_ctx = !kref_put(&ctxi->kref, remove_context);
+ if (kref_put(&ctxi->kref, remove_context))
+ put_ctx = false;
scsi_device_put(sdev);
out:
if (put_ctx)