Skip to content

Commit e14f1f8

Browse files
sreekanthbrcmgregkh
authored andcommitted
scsi: mpt3sas: Free diag buffer without any status check
[ Upstream commit 764f472 ] Memory leak can happen when diag buffer is released but not unregistered (where buffer is deallocated) by the user. During module unload time driver is not deallocating the buffer if the buffer is in released state. Deallocate the diag buffer during module unload time without any diag buffer status checks. Link: https://lore.kernel.org/r/1568379890-18347-5-git-send-email-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy <sreekanth.reddy@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 6b8fbd9 commit e14f1f8

1 file changed

Lines changed: 0 additions & 6 deletions

File tree

‎drivers/scsi/mpt3sas/mpt3sas_ctl.c‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3717,12 +3717,6 @@ mpt3sas_ctl_exit(ushort hbas_to_enumerate)
37173717
for (i = 0; i < MPI2_DIAG_BUF_TYPE_COUNT; i++) {
37183718
if (!ioc->diag_buffer[i])
37193719
continue;
3720-
if (!(ioc->diag_buffer_status[i] &
3721-
MPT3_DIAG_BUFFER_IS_REGISTERED))
3722-
continue;
3723-
if ((ioc->diag_buffer_status[i] &
3724-
MPT3_DIAG_BUFFER_IS_RELEASED))
3725-
continue;
37263720
dma_free_coherent(&ioc->pdev->dev,
37273721
ioc->diag_buffer_sz[i],
37283722
ioc->diag_buffer[i],

0 commit comments

Comments
 (0)