Input: omap4-keypad - fix memory leak
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>
Mon, 28 Sep 2015 22:59:22 +0000 (15:59 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 28 Sep 2015 23:05:45 +0000 (16:05 -0700)
If omap4_keypad_parse_dt() fails we returned the error code but we
missed releasing keypad_data.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/keyboard/omap4-keypad.c

index b052afec9a11f0d323eb735dee3d262eabf116a2..6639b2b8528aa6da9a518d3bd3dc0da3010f4a09 100644 (file)
@@ -266,7 +266,7 @@ static int omap4_keypad_probe(struct platform_device *pdev)
 
        error = omap4_keypad_parse_dt(&pdev->dev, keypad_data);
        if (error)
-               return error;
+               goto err_free_keypad;
 
        res = request_mem_region(res->start, resource_size(res), pdev->name);
        if (!res) {