backlight: max8925_bl: Fix error handling path
authorAxel Lin <axel.lin@gmail.com>
Mon, 10 May 2010 01:27:34 +0000 (09:27 +0800)
committerRichard Purdie <rpurdie@linux.intel.com>
Wed, 26 May 2010 16:34:36 +0000 (17:34 +0100)
Properly unregister a previously registered backlight device object in error
handling of max8925_backlight_probe.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
drivers/video/backlight/max8925_bl.c

index b5accc957ad37e50d5644f68749bb37d44667acf..b2b2c7ba1f63f1d1865d2b490f685fa27c2bb6b3 100644 (file)
@@ -162,6 +162,7 @@ static int __devinit max8925_backlight_probe(struct platform_device *pdev)
        backlight_update_status(bl);
        return 0;
 out:
+       backlight_device_unregister(bl);
        kfree(data);
        return ret;
 }