aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_attr.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_attr.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_attr.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index 049e5cf1af7f..73d10b35091e 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -113,7 +113,7 @@ qla2x00_sysfs_read_nvram(struct kobject *kobj, char *buf, loff_t off,
113 struct device, kobj))); 113 struct device, kobj)));
114 unsigned long flags; 114 unsigned long flags;
115 115
116 if (!capable(CAP_SYS_ADMIN) || off != 0 || count != ha->nvram_size) 116 if (!capable(CAP_SYS_ADMIN) || off != 0)
117 return 0; 117 return 0;
118 118
119 /* Read NVRAM. */ 119 /* Read NVRAM. */
@@ -122,7 +122,7 @@ qla2x00_sysfs_read_nvram(struct kobject *kobj, char *buf, loff_t off,
122 ha->nvram_size); 122 ha->nvram_size);
123 spin_unlock_irqrestore(&ha->hardware_lock, flags); 123 spin_unlock_irqrestore(&ha->hardware_lock, flags);
124 124
125 return (count); 125 return ha->nvram_size;
126} 126}
127 127
128static ssize_t 128static ssize_t
@@ -174,7 +174,7 @@ static struct bin_attribute sysfs_nvram_attr = {
174 .mode = S_IRUSR | S_IWUSR, 174 .mode = S_IRUSR | S_IWUSR,
175 .owner = THIS_MODULE, 175 .owner = THIS_MODULE,
176 }, 176 },
177 .size = 0, 177 .size = 512,
178 .read = qla2x00_sysfs_read_nvram, 178 .read = qla2x00_sysfs_read_nvram,
179 .write = qla2x00_sysfs_write_nvram, 179 .write = qla2x00_sysfs_write_nvram,
180}; 180};
@@ -185,7 +185,6 @@ qla2x00_alloc_sysfs_attr(scsi_qla_host_t *ha)
185 struct Scsi_Host *host = ha->host; 185 struct Scsi_Host *host = ha->host;
186 186
187 sysfs_create_bin_file(&host->shost_gendev.kobj, &sysfs_fw_dump_attr); 187 sysfs_create_bin_file(&host->shost_gendev.kobj, &sysfs_fw_dump_attr);
188 sysfs_nvram_attr.size = ha->nvram_size;
189 sysfs_create_bin_file(&host->shost_gendev.kobj, &sysfs_nvram_attr); 188 sysfs_create_bin_file(&host->shost_gendev.kobj, &sysfs_nvram_attr);
190} 189}
191 190