aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libiscsi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/libiscsi.c')
-rw-r--r--drivers/scsi/libiscsi.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index d430e227e9b7..5e6a42429c39 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -1463,6 +1463,7 @@ void iscsi_session_teardown(struct iscsi_cls_session *cls_session)
1463 1463
1464 kfree(session->targetname); 1464 kfree(session->targetname);
1465 kfree(session->hwaddress); 1465 kfree(session->hwaddress);
1466 kfree(session->initiatorname);
1466 1467
1467 iscsi_destroy_session(cls_session); 1468 iscsi_destroy_session(cls_session);
1468 scsi_host_put(shost); 1469 scsi_host_put(shost);
@@ -2004,6 +2005,13 @@ int iscsi_host_get_param(struct Scsi_Host *shost, enum iscsi_host_param param,
2004 else 2005 else
2005 len = sprintf(buf, "%s\n", session->hwaddress); 2006 len = sprintf(buf, "%s\n", session->hwaddress);
2006 break; 2007 break;
2008 case ISCSI_HOST_PARAM_INITIATOR_NAME:
2009 if (!session->initiatorname)
2010 len = sprintf(buf, "%s\n", "unknown");
2011 else
2012 len = sprintf(buf, "%s\n", session->initiatorname);
2013 break;
2014
2007 default: 2015 default:
2008 return -ENOSYS; 2016 return -ENOSYS;
2009 } 2017 }
@@ -2022,6 +2030,10 @@ int iscsi_host_set_param(struct Scsi_Host *shost, enum iscsi_host_param param,
2022 if (!session->hwaddress) 2030 if (!session->hwaddress)
2023 session->hwaddress = kstrdup(buf, GFP_KERNEL); 2031 session->hwaddress = kstrdup(buf, GFP_KERNEL);
2024 break; 2032 break;
2033 case ISCSI_HOST_PARAM_INITIATOR_NAME:
2034 if (!session->initiatorname)
2035 session->initiatorname = kstrdup(buf, GFP_KERNEL);
2036 break;
2025 default: 2037 default:
2026 return -ENOSYS; 2038 return -ENOSYS;
2027 } 2039 }