summaryrefslogtreecommitdiff
path: root/drivers/scsi/qedi/qedi_iscsi.c
diff options
context:
space:
mode:
authorElena Reshetova <elena.reshetova@intel.com>2017-03-09 14:46:58 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2017-03-16 01:44:39 +0300
commit6dc618cdd6b896791313926becb1f86ede0e046a (patch)
treee4b0637932e6f5ce980720b12fc253e6bfcf2b74 /drivers/scsi/qedi/qedi_iscsi.c
parent22c70d1a9c639b432ffdf083bea44752ad9fc8f3 (diff)
downloadlinux-6dc618cdd6b896791313926becb1f86ede0e046a.tar.xz
scsi: libiscsi: qedi: convert iscsi_task.refcount from atomic_t to refcount_t
refcount_t type and corresponding API should be used instead of atomic_t when the variable is used as a reference counter. This allows to avoid accidental refcounter overflows that might lead to use-after-free situations. Signed-off-by: Elena Reshetova <elena.reshetova@intel.com> Signed-off-by: Hans Liljestrand <ishkamiel@gmail.com> Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: David Windsor <dwindsor@gmail.com> Acked-by: Chris Leech <cleech@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/qedi/qedi_iscsi.c')
-rw-r--r--drivers/scsi/qedi/qedi_iscsi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/qedi/qedi_iscsi.c b/drivers/scsi/qedi/qedi_iscsi.c
index b9f79d36142d..3895bd555746 100644
--- a/drivers/scsi/qedi/qedi_iscsi.c
+++ b/drivers/scsi/qedi/qedi_iscsi.c
@@ -1372,7 +1372,7 @@ static void qedi_cleanup_task(struct iscsi_task *task)
{
if (!task->sc || task->state == ISCSI_TASK_PENDING) {
QEDI_INFO(NULL, QEDI_LOG_IO, "Returning ref_cnt=%d\n",
- atomic_read(&task->refcount));
+ refcount_read(&task->refcount));
return;
}