Commit b43f1886 authored by Nicholas Bellinger's avatar Nicholas Bellinger

tcm_loop: Fix memory leak in tcm_loop_submission_work error path

This patch fixes a tcm_loop_cmd descriptor memory leak in the
tcm_loop_submission_work() error path, and would result in
warnings about leaked tcm_loop_cmd_cache objects at module
unload time.

Go ahead and invoke kmem_cache_free() to release tl_cmd back to
tcm_loop_cmd_cache before calling sc->scsi_done().
Reported-by: default avatarSebastian Herbszt <herbszt@gmx.de>
Tested-by: default avatarSebastian Herbszt <herbszt@gmx.de>
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent 68349756
......@@ -239,6 +239,7 @@ static void tcm_loop_submission_work(struct work_struct *work)
return;
out_done:
kmem_cache_free(tcm_loop_cmd_cache, tl_cmd);
sc->scsi_done(sc);
return;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment