Re: [PATCH] scsi: scsi_debug: Fix memory leak on module unload

From: Martin K. Petersen
Date: Mon Jun 18 2018 - 22:17:45 EST



Luis,

> Since commit 80c49563e250 ("scsi: scsi_debug: implement IMMED bit")
> there are long delays in F_SYNC_DELAY and F_SSU_DELAY. This can cause
> a memory leak in schedule_resp(), which can be invoked while unloading
> the scsi_debug module: free_all_queued() had already freed all sd_dp
> and schedule_resp will alloc a new one, which will never get freed.
> Here's the kmemleak report while running xfstests generic/350:

Applied to 4.18/scsi-fixes. Thank you!

--
Martin K. Petersen Oracle Linux Engineering