fjes: fix missed check in fjes_acpi_add
authorChuhong Yuan <hslester96@gmail.com>
Mon, 9 Dec 2019 16:22:07 +0000 (00:22 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 9 Dec 2019 22:41:25 +0000 (14:41 -0800)
fjes_acpi_add() misses a check for platform_device_register_simple().
Add a check to fix it.

Fixes: 658d439b2292 ("fjes: Introduce FUJITSU Extended Socket Network Device driver")
Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/fjes/fjes_main.c

index b517c1af9de052d6d5fcc2d8b249d8544d5b49b9..91a1059517f55adc66cbeaed328a6077fa47b0d1 100644 (file)
@@ -166,6 +166,9 @@ static int fjes_acpi_add(struct acpi_device *device)
        /* create platform_device */
        plat_dev = platform_device_register_simple(DRV_NAME, 0, fjes_resource,
                                                   ARRAY_SIZE(fjes_resource));
+       if (IS_ERR(plat_dev))
+               return PTR_ERR(plat_dev);
+
        device->driver_data = plat_dev;
 
        return 0;