tcm_fc: Fix crash seen with aborts and large reads
authorMark Rustad <mark.d.rustad@intel.com>
Sat, 14 Jul 2012 01:18:04 +0000 (18:18 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 29 Jul 2012 15:04:18 +0000 (08:04 -0700)
commit8db5153f9dca89afbeebe0b077e7cc1e5827e07a
treef82d65c99c59f3855e91678d790603f085429920
parentfd25080998d00a94a87bf7fc9f843291db7250a6
tcm_fc: Fix crash seen with aborts and large reads

commit 3cc5d2a6b9a2fd1bf024aa5e52dd22961eecaf13 upstream.

This patch fixes a crash seen when large reads have their exchange
aborted by either timing out or being reset. Because the exchange
abort results in the seq pointer being set to NULL, because the
sequence is no longer valid, it must not be dereferenced. This
patch changes the function ft_get_task_tag to return ~0 if it is
unable to get the tag for this reason. Because the get_task_tag
interface provides no means of returning an error, this seems
like the best way to fix this issue at the moment.

Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/target/tcm_fc/tfc_cmd.c