scsi: qla2xxx: Prevent SysFS access when chip is down

Prevent user from sending commands through sysfs while FW is not running or
reset is in progress.

Signed-off-by: Quinn Tran <qtran@marvell.com>
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
Quinn Tran 2019-02-15 14:37:18 -08:00 committed by Martin K. Petersen
parent 4910b524ac
commit b726d99d72
1 changed files with 3 additions and 0 deletions

View File

@ -543,6 +543,9 @@ qla2x00_sysfs_write_vpd(struct file *filp, struct kobject *kobj,
if (unlikely(pci_channel_offline(ha->pdev)))
return 0;
if (qla2x00_chip_is_down(vha))
return 0;
if (!capable(CAP_SYS_ADMIN) || off != 0 || count != ha->vpd_size ||
!ha->isp_ops->write_nvram)
return 0;