Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b726d99d authored by Quinn Tran's avatar Quinn Tran Committed by Martin K. Petersen
Browse files

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: default avatarQuinn Tran <qtran@marvell.com>
Signed-off-by: default avatarHimanshu Madhani <hmadhani@marvell.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 4910b524
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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;