compal-laptop: Check return value of power_supply_register
[pandora-kernel.git] / drivers / platform / x86 / compal-laptop.c
index eb9885e..bceb30b 100644 (file)
@@ -1036,7 +1036,9 @@ static int compal_probe(struct platform_device *pdev)
 
        /* Power supply */
        initialize_power_supply_data(data);
-       power_supply_register(&compal_device->dev, &data->psy);
+       err = power_supply_register(&compal_device->dev, &data->psy);
+       if (err < 0)
+               goto remove;
 
        platform_set_drvdata(pdev, data);