]> git.hungrycats.org Git - linux/commit
sbp-target: fix error path in sbp_make_tpg()
authorChris Boot <bootc@bootc.net>
Tue, 11 Dec 2012 21:58:48 +0000 (21:58 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Jan 2013 16:45:58 +0000 (08:45 -0800)
commitffd939ebf39c50a5f4e192870125bd6e2875f05d
tree739eb7220dc047ea5ed409a43efa7edaa216dbb2
parent3930216ba48431031d13f7ef757363852040a058
sbp-target: fix error path in sbp_make_tpg()

commit e1fe2060d7e8f58a69374135e32e90f0bb79a7fd upstream.

If the TPG memory is allocated successfully, but we fail further along
in the function, a dangling pointer to freed memory is left in the TPort
structure. This is mostly harmless, but does prevent re-trying the
operation without first removing the TPort altogether.

Reported-by: Chen Gang <gang.chen@asianux.com>
Signed-off-by: Chris Boot <bootc@bootc.net>
Cc: Andy Grover <agrover@redhat.com>
Cc: Nicholas A. Bellinger <nab@linux-iscsi.org>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/target/sbp/sbp_target.c