]> git.baikalelectronics.ru Git - kernel.git/commit
loopback: Fix memory leak in tcm_loop_make_scsi_hba()
authorJesper Juhl <jj@chaosbits.net>
Mon, 27 Jun 2011 22:30:17 +0000 (00:30 +0200)
committerNicholas Bellinger <nab@linux-iscsi.org>
Fri, 22 Jul 2011 09:37:46 +0000 (09:37 +0000)
commitaeb3dedd12a404371c805d087c48a302b0d8028b
tree4879b45aec4865ee6c7df64cf7a71b56f75e9238
parentbd47f5588e40e9fec968fbe3d810268d444f0f81
loopback: Fix memory leak in tcm_loop_make_scsi_hba()

There is a memory leak in tcm_loop_make_scsi_hba().

If all the strstr() calls return NULL and we end up at return ERR_PTR(-EINVAL);
then we'll be leaking the memory previously allocated to tl_hba as
that variable goes out of scope.

This patch should fix the leak.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/loopback/tcm_loop.c