misc: pci_endpoint_test: Fix to support > 10 pci-endpoint-test devices
authorKishon Vijay Abraham I <kishon@ti.com>
Tue, 17 Mar 2020 10:01:57 +0000 (15:31 +0530)
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Thu, 2 Apr 2020 16:57:10 +0000 (17:57 +0100)
Adding more than 10 pci-endpoint-test devices results in
"kobject_add_internal failed for pci-endpoint-test.1 with -EEXIST, don't
try to register things with the same name in the same directory". This
is because commit 2c156ac71c6b ("misc: Add host side PCI driver for PCI
test function device") limited the length of the "name" to 20 characters.
Change the length of the name to 24 in order to support upto 10000
pci-endpoint-test devices.

Fixes: 2c156ac71c6b ("misc: Add host side PCI driver for PCI test function device")
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: stable@vger.kernel.org # v4.14+
drivers/misc/pci_endpoint_test.c

index bb8b94ac8d3bfc82f4259846bb65938cacd08f4e..ef21d2d2f8ae9b5b74fab9461c6d2bcb514717a9 100644 (file)
@@ -749,7 +749,7 @@ static int pci_endpoint_test_probe(struct pci_dev *pdev,
 {
        int err;
        int id;
-       char name[20];
+       char name[24];
        enum pci_barno bar;
        void __iomem *base;
        struct device *dev = &pdev->dev;