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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 5 Oct 2014 21:52:18 +0000 (14:52 -0700)
commitf3c8aba3bc795c2241aeaf3d1e92ab4d5a6c0682
treefcc43d6d5275ca2c1341ac1beac370ac7804541f
parentb329630e27bcbcbc12e4b29d5bdbb82b5702968b
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/target/iscsi/iscsi_target.c