platform/x86: mlx-platform: Fix error handling in mlxplat_init()
authorWei Yongjun <weiyongjun1@huawei.com>
Tue, 9 Jul 2019 01:38:42 +0000 (01:38 +0000)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 12 Jul 2019 13:00:38 +0000 (16:00 +0300)
Add the missing platform_device_unregister() before return
from mlxplat_init() in the error handling case.

Fixes: 6b266e91a071 ("platform/x86: mlx-platform: Move regmap initialization before all drivers activation")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/platform/x86/mlx-platform.c

index 2b98f29..8fe51e4 100644 (file)
@@ -2111,7 +2111,7 @@ static int __init mlxplat_init(void)
                                        mlxplat_regmap_config);
        if (IS_ERR(priv->regmap)) {
                err = PTR_ERR(priv->regmap);
-               return err;
+               goto fail_alloc;
        }
 
        err = mlxplat_mlxcpld_verify_bus_topology(&nr);