Do not allow adding the same device multiple times.

Coverity issue: 383663
Fixes: 17c839f74da3 ("bus: add platform bus")

Signed-off-by: Tomasz Duszynski <tduszyn...@marvell.com>
---
 drivers/bus/platform/platform.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/bus/platform/platform.c b/drivers/bus/platform/platform.c
index a2faacdf18..d4b53f6fbc 100644
--- a/drivers/bus/platform/platform.c
+++ b/drivers/bus/platform/platform.c
@@ -103,6 +103,7 @@ dev_add(const char *dev_name)
                                rte_devargs_remove(pdev->device.devargs);
 
                        free(pdev);
+                       return -EEXIST;
                }
        }
 
-- 
2.34.1

Reply via email to