From: Nicholas Bellinger Date: Thu, 22 Aug 2013 22:35:45 +0000 (-0700) Subject: target: Avoid non-existent tg_pt_gp_mem in target_alua_state_check X-Git-Tag: next-20130912~17^2~16 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=89c12cc925a7d0982dc53b743a42108acc76aef4;p=karo-tx-linux.git target: Avoid non-existent tg_pt_gp_mem in target_alua_state_check This patch adds an check for a non-existent port->sep_alua_tg_pt_gp_mem within target_alua_state_check(), which is not present for internally dispatched EXTENDED_COPY WRITE I/O to the destination target port. Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: Martin Petersen Cc: Chris Mason Cc: Roland Dreier Cc: Zach Brown Cc: James Bottomley Cc: Nicholas Bellinger Signed-off-by: Nicholas Bellinger --- diff --git a/drivers/target/target_core_alua.c b/drivers/target/target_core_alua.c index 5403186e4777..ea928c4d8854 100644 --- a/drivers/target/target_core_alua.c +++ b/drivers/target/target_core_alua.c @@ -557,6 +557,9 @@ target_alua_state_check(struct se_cmd *cmd) * a ALUA logical unit group. */ tg_pt_gp_mem = port->sep_alua_tg_pt_gp_mem; + if (!tg_pt_gp_mem) + return 0; + spin_lock(&tg_pt_gp_mem->tg_pt_gp_mem_lock); tg_pt_gp = tg_pt_gp_mem->tg_pt_gp; out_alua_state = atomic_read(&tg_pt_gp->tg_pt_gp_alua_access_state);