backlight: fix memory leak on obscure error path
authorMartlin Ettl <ettl.martin@gmx.de>
Thu, 5 Jul 2012 16:58:46 +0000 (17:58 +0100)
committerJiri Kosina <jkosina@suse.cz>
Mon, 9 Jul 2012 14:20:11 +0000 (16:20 +0200)
Dredged out of bugzilla

Reported-by: Martlin Ettl <ettl.martin@gmx.de>
Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=15492
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/video/backlight/88pm860x_bl.c

index f49181c7311390c471b0abc6caa6d8ca6ae4de91..f75da8758adcf79612d6a8b5b566a00624a0e42f 100644 (file)
@@ -228,6 +228,7 @@ static int pm860x_backlight_probe(struct platform_device *pdev)
        data->port = pdata->flags;
        if (data->port < 0) {
                dev_err(&pdev->dev, "wrong platform data is assigned");
+               kfree(data);
                return -EINVAL;
        }