]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
powerpc/pseries: pci - logic bug
authorGeorge Wilson <gcwilson@linux.ibm.com>
Fri, 7 Aug 2026 16:58:36 +0000 (11:58 -0500)
committerMadhavan Srinivasan <maddy@linux.ibm.com>
Sat, 8 Aug 2026 05:03:42 +0000 (10:33 +0530)
The checks on num_vfs in pseries_pci_sriov_enable() are ANDed where OR
was apparently intended.  Change it to OR.

Fixes: 9a7f6b438664 ("powerpc/pseries/pci: Associate PEs to VFs in configure SR-IOV")
Acked-by: Nayna Jain <nayna@linux.ibm.com>
Tested-by: R Nageswara Sastry <rnsastry@linux.ibm.com>
Cc: stable@vger.kernel.org # 4.16
Signed-off-by: George Wilson <gcwilson@linux.ibm.com>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
arch/powerpc/platforms/pseries/pci.c

index 84e4ffe957a86a6a28998358559751a7cd7844a8..d11a64a086c143a7d820f2015364261e7acb1362 100644 (file)
@@ -132,7 +132,7 @@ static int pseries_pci_sriov_enable(struct pci_dev *pdev, u16 num_vfs)
 
        /* First integer stores max config */
        max_config_vfs = of_read_number(&max_vfs[0], 1);
-       if (max_config_vfs < num_vfs && num_vfs > MAX_VFS_FOR_MAP_PE) {
+       if (max_config_vfs < num_vfs || num_vfs > MAX_VFS_FOR_MAP_PE) {
                dev_err(&pdev->dev,
                        "Num VFs %x > %x Configurable VFs\n",
                        num_vfs, (num_vfs > MAX_VFS_FOR_MAP_PE) ?