Skip to content

Commit 1fdd142

Browse files
tang.junhuimartinkpetersen
authored andcommitted
scsi: scsi_dh_alua: fix missing kref_put() in alua_rtpg_work()
Reference count of pg leaks in alua_rtpg_work() since kref_put() is not called to decrease the reference count of pg when the condition pg->rtpg_sdev==NULL satisfied (actually it is easy to satisfy), it would cause memory of pg leakage. Signed-off-by: tang.junhui <tang.junhui@zte.com.cn> Cc: <stable@vger.kernel.org> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 2bf7dc8 commit 1fdd142

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/scsi/device_handler/scsi_dh_alua.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -793,6 +793,7 @@ static void alua_rtpg_work(struct work_struct *work)
793793
WARN_ON(pg->flags & ALUA_PG_RUN_RTPG);
794794
WARN_ON(pg->flags & ALUA_PG_RUN_STPG);
795795
spin_unlock_irqrestore(&pg->lock, flags);
796+
kref_put(&pg->kref, release_port_group);
796797
return;
797798
}
798799
if (pg->flags & ALUA_SYNC_STPG)

0 commit comments

Comments
 (0)