Explorar o código

tcm_loop: Check for valid hba in tcm_loop_drop_nexus()

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Hannes Reinecke %!s(int64=11) %!d(string=hai) anos
pai
achega
1ec59fee29
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      drivers/target/loopback/tcm_loop.c

+ 4 - 1
drivers/target/loopback/tcm_loop.c

@@ -932,7 +932,10 @@ static int tcm_loop_drop_nexus(
 	struct tcm_loop_nexus *tl_nexus;
 	struct tcm_loop_hba *tl_hba = tpg->tl_hba;
 
-	tl_nexus = tpg->tl_hba->tl_nexus;
+	if (!tl_hba)
+		return -ENODEV;
+
+	tl_nexus = tl_hba->tl_nexus;
 	if (!tl_nexus)
 		return -ENODEV;