提交 6431c5dc 编写于 作者: A Andrew Vasquez 提交者: James Bottomley

[SCSI] qla2xxx: Correct address range checking for option-rom updates.

Signed-off-by: NAndrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
上级 4469c195
...@@ -244,12 +244,6 @@ qla2x00_sysfs_write_optrom_ctl(struct kobject *kobj, ...@@ -244,12 +244,6 @@ qla2x00_sysfs_write_optrom_ctl(struct kobject *kobj,
if (ha->optrom_state != QLA_SWAITING) if (ha->optrom_state != QLA_SWAITING)
break; break;
if (start & 0xfff) {
qla_printk(KERN_WARNING, ha,
"Invalid start region 0x%x/0x%x.\n", start, size);
return -EINVAL;
}
ha->optrom_region_start = start; ha->optrom_region_start = start;
ha->optrom_region_size = start + size > ha->optrom_size ? ha->optrom_region_size = start + size > ha->optrom_size ?
ha->optrom_size - start : size; ha->optrom_size - start : size;
...@@ -303,8 +297,7 @@ qla2x00_sysfs_write_optrom_ctl(struct kobject *kobj, ...@@ -303,8 +297,7 @@ qla2x00_sysfs_write_optrom_ctl(struct kobject *kobj,
else if (start == (ha->flt_region_boot * 4) || else if (start == (ha->flt_region_boot * 4) ||
start == (ha->flt_region_fw * 4)) start == (ha->flt_region_fw * 4))
valid = 1; valid = 1;
else if ((IS_QLA25XX(ha) || IS_QLA81XX(ha)) && else if (IS_QLA25XX(ha) || IS_QLA81XX(ha))
start == (ha->flt_region_vpd_nvram * 4))
valid = 1; valid = 1;
if (!valid) { if (!valid) {
qla_printk(KERN_WARNING, ha, qla_printk(KERN_WARNING, ha,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册