summaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorQuinn Tran <qtran@marvell.com>2019-02-15 23:37:18 +0100
committerMartin K. Petersen <martin.petersen@oracle.com>2019-02-20 00:58:36 +0100
commitb726d99d72fd4b36ae82efb35d0073b0c9441205 (patch)
treea9e8b8cc7698e224a2070ccbccb5a1732488743b /drivers/scsi
parentscsi: qla2xxx: Add support for setting port speed (diff)
downloadlinux-b726d99d72fd4b36ae82efb35d0073b0c9441205.tar.xz
linux-b726d99d72fd4b36ae82efb35d0073b0c9441205.zip
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>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/qla2xxx/qla_attr.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index ee9f943f4d07..f8fd482a06e0 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -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;