aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/target/loopback/tcm_loop.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/target/loopback/tcm_loop.c')
-rw-r--r--drivers/target/loopback/tcm_loop.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/target/loopback/tcm_loop.c b/drivers/target/loopback/tcm_loop.c
index e53cec64ddd..fe11a336b59 100644
--- a/drivers/target/loopback/tcm_loop.c
+++ b/drivers/target/loopback/tcm_loop.c
@@ -1288,22 +1288,21 @@ struct se_wwn *tcm_loop_make_scsi_hba(
1288 goto check_len; 1288 goto check_len;
1289 } 1289 }
1290 ptr = strstr(name, "iqn."); 1290 ptr = strstr(name, "iqn.");
1291 if (ptr) { 1291 if (!ptr) {
1292 tl_hba->tl_proto_id = SCSI_PROTOCOL_ISCSI; 1292 printk(KERN_ERR "Unable to locate prefix for emulated Target "
1293 goto check_len; 1293 "Port: %s\n", name);
1294 ret = -EINVAL;
1295 goto out;
1294 } 1296 }
1295 1297 tl_hba->tl_proto_id = SCSI_PROTOCOL_ISCSI;
1296 printk(KERN_ERR "Unable to locate prefix for emulated Target Port:"
1297 " %s\n", name);
1298 return ERR_PTR(-EINVAL);
1299 1298
1300check_len: 1299check_len:
1301 if (strlen(name) >= TL_WWN_ADDR_LEN) { 1300 if (strlen(name) >= TL_WWN_ADDR_LEN) {
1302 printk(KERN_ERR "Emulated NAA %s Address: %s, exceeds" 1301 printk(KERN_ERR "Emulated NAA %s Address: %s, exceeds"
1303 " max: %d\n", name, tcm_loop_dump_proto_id(tl_hba), 1302 " max: %d\n", name, tcm_loop_dump_proto_id(tl_hba),
1304 TL_WWN_ADDR_LEN); 1303 TL_WWN_ADDR_LEN);
1305 kfree(tl_hba); 1304 ret = -EINVAL;
1306 return ERR_PTR(-EINVAL); 1305 goto out;
1307 } 1306 }
1308 snprintf(&tl_hba->tl_wwn_address[0], TL_WWN_ADDR_LEN, "%s", &name[off]); 1307 snprintf(&tl_hba->tl_wwn_address[0], TL_WWN_ADDR_LEN, "%s", &name[off]);
1309 1308