iscsi-target: Fix memory corruption in iscsit_logout_post_handler_diffcid
authorNicholas Bellinger <nab@linux-iscsi.org>
Wed, 17 Sep 2014 18:45:17 +0000 (11:45 -0700)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 5 Nov 2014 20:27:44 +0000 (20:27 +0000)
commit9c0e738c62a1b547590b5c4ce3ccf23cec371284
tree61eb0731218f963ab655ef6a5301d5858a774d90
parent1a4ba51a1d7def5f36b7dec2defd3c4ab27e9fb0
iscsi-target: Fix memory corruption in iscsit_logout_post_handler_diffcid

commit b53b0d99d6fbf7d44330395349a895521cfdbc96 upstream.

This patch fixes a bug in iscsit_logout_post_handler_diffcid() where
a pointer used as storage for list_for_each_entry() was incorrectly
being used to determine if no matching entry had been found.

This patch changes iscsit_logout_post_handler_diffcid() to key off
bool conn_found to determine if the function needs to exit early.

Reported-by: Joern Engel <joern@logfs.org>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/target/iscsi/iscsi_target.c