Skip to content

Commit

Permalink
scsi: qla2xxx: Prevent SysFS access when chip is down
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Quinn Tran authored and Martin K. Petersen committed Feb 19, 2019
1 parent 4910b52 commit b726d99
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/scsi/qla2xxx/qla_attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b726d99

Please sign in to comment.