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.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index 877990115f53..79bf7514a385 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -111,7 +111,8 @@ qla2x00_sysfs_write_nvram(struct kobject *kobj,
111 struct qla_hw_data *ha = vha->hw; 111 struct qla_hw_data *ha = vha->hw;
112 uint16_t cnt; 112 uint16_t cnt;
113 113
114 if (!capable(CAP_SYS_ADMIN) || off != 0 || count != ha->nvram_size) 114 if (!capable(CAP_SYS_ADMIN) || off != 0 || count != ha->nvram_size ||
115 !ha->isp_ops->write_nvram)
115 return 0; 116 return 0;
116 117
117 /* Checksum NVRAM. */ 118 /* Checksum NVRAM. */
@@ -393,7 +394,8 @@ qla2x00_sysfs_write_vpd(struct kobject *kobj,
393 struct qla_hw_data *ha = vha->hw; 394 struct qla_hw_data *ha = vha->hw;
394 uint8_t *tmp_data; 395 uint8_t *tmp_data;
395 396
396 if (!capable(CAP_SYS_ADMIN) || off != 0 || count != ha->vpd_size) 397 if (!capable(CAP_SYS_ADMIN) || off != 0 || count != ha->vpd_size ||
398 !ha->isp_ops->write_nvram)
397 return 0; 399 return 0;
398 400
399 if (qla2x00_wait_for_hba_online(vha) != QLA_SUCCESS) { 401 if (qla2x00_wait_for_hba_online(vha) != QLA_SUCCESS) {