diff options
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/pcie/aspm.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c index e61b82e611c2..eee09f756ec9 100644 --- a/drivers/pci/pcie/aspm.c +++ b/drivers/pci/pcie/aspm.c | |||
@@ -770,6 +770,8 @@ static int pcie_aspm_set_policy(const char *val, struct kernel_param *kp) | |||
770 | int i; | 770 | int i; |
771 | struct pcie_link_state *link; | 771 | struct pcie_link_state *link; |
772 | 772 | ||
773 | if (aspm_disabled) | ||
774 | return -EPERM; | ||
773 | for (i = 0; i < ARRAY_SIZE(policy_str); i++) | 775 | for (i = 0; i < ARRAY_SIZE(policy_str); i++) |
774 | if (!strncmp(val, policy_str[i], strlen(policy_str[i]))) | 776 | if (!strncmp(val, policy_str[i], strlen(policy_str[i]))) |
775 | break; | 777 | break; |
@@ -824,6 +826,8 @@ static ssize_t link_state_store(struct device *dev, | |||
824 | struct pcie_link_state *link, *root = pdev->link_state->root; | 826 | struct pcie_link_state *link, *root = pdev->link_state->root; |
825 | u32 val = buf[0] - '0', state = 0; | 827 | u32 val = buf[0] - '0', state = 0; |
826 | 828 | ||
829 | if (aspm_disabled) | ||
830 | return -EPERM; | ||
827 | if (n < 1 || val > 3) | 831 | if (n < 1 || val > 3) |
828 | return -EINVAL; | 832 | return -EINVAL; |
829 | 833 | ||