tcm_loop: Check for valid hba in tcm_loop_drop_nexus()

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Fri Nov 22 17:59:08 EST 2013


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=1ec59fee296d798b83a11f888981531dae16bfe8
Commit:     1ec59fee296d798b83a11f888981531dae16bfe8
Parent:     a309f489608f09c5053a2fb4ae8e3d849adb2b33
Author:     Hannes Reinecke <hare at suse.de>
AuthorDate: Wed Oct 16 09:12:52 2013 +0200
Committer:  Nicholas Bellinger <nab at linux-iscsi.org>
CommitDate: Wed Oct 16 13:44:05 2013 -0700

    tcm_loop: Check for valid hba in tcm_loop_drop_nexus()
    
    Signed-off-by: Hannes Reinecke <hare at suse.de>
    Signed-off-by: Nicholas Bellinger <nab at linux-iscsi.org>
---
 drivers/target/loopback/tcm_loop.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/target/loopback/tcm_loop.c b/drivers/target/loopback/tcm_loop.c
index 150bdb4..21b49f3 100644
--- a/drivers/target/loopback/tcm_loop.c
+++ b/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;
 



More information about the linux-mtd-cvs mailing list