diff options
Diffstat (limited to 'drivers/scsi/libiscsi.c')
-rw-r--r-- | drivers/scsi/libiscsi.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c index 1632866f52cc..865dd5739f0e 100644 --- a/drivers/scsi/libiscsi.c +++ b/drivers/scsi/libiscsi.c | |||
@@ -1483,6 +1483,7 @@ void iscsi_session_teardown(struct iscsi_cls_session *cls_session) | |||
1483 | kfree(session->username); | 1483 | kfree(session->username); |
1484 | kfree(session->username_in); | 1484 | kfree(session->username_in); |
1485 | kfree(session->targetname); | 1485 | kfree(session->targetname); |
1486 | kfree(session->netdev); | ||
1486 | kfree(session->hwaddress); | 1487 | kfree(session->hwaddress); |
1487 | kfree(session->initiatorname); | 1488 | kfree(session->initiatorname); |
1488 | 1489 | ||
@@ -2040,6 +2041,12 @@ int iscsi_host_get_param(struct Scsi_Host *shost, enum iscsi_host_param param, | |||
2040 | int len; | 2041 | int len; |
2041 | 2042 | ||
2042 | switch (param) { | 2043 | switch (param) { |
2044 | case ISCSI_HOST_PARAM_NETDEV_NAME: | ||
2045 | if (!session->netdev) | ||
2046 | len = sprintf(buf, "%s\n", "default"); | ||
2047 | else | ||
2048 | len = sprintf(buf, "%s\n", session->netdev); | ||
2049 | break; | ||
2043 | case ISCSI_HOST_PARAM_HWADDRESS: | 2050 | case ISCSI_HOST_PARAM_HWADDRESS: |
2044 | if (!session->hwaddress) | 2051 | if (!session->hwaddress) |
2045 | len = sprintf(buf, "%s\n", "default"); | 2052 | len = sprintf(buf, "%s\n", "default"); |
@@ -2067,6 +2074,10 @@ int iscsi_host_set_param(struct Scsi_Host *shost, enum iscsi_host_param param, | |||
2067 | struct iscsi_session *session = iscsi_hostdata(shost->hostdata); | 2074 | struct iscsi_session *session = iscsi_hostdata(shost->hostdata); |
2068 | 2075 | ||
2069 | switch (param) { | 2076 | switch (param) { |
2077 | case ISCSI_HOST_PARAM_NETDEV_NAME: | ||
2078 | if (!session->netdev) | ||
2079 | session->netdev = kstrdup(buf, GFP_KERNEL); | ||
2080 | break; | ||
2070 | case ISCSI_HOST_PARAM_HWADDRESS: | 2081 | case ISCSI_HOST_PARAM_HWADDRESS: |
2071 | if (!session->hwaddress) | 2082 | if (!session->hwaddress) |
2072 | session->hwaddress = kstrdup(buf, GFP_KERNEL); | 2083 | session->hwaddress = kstrdup(buf, GFP_KERNEL); |