From: Fabio Estevam Date: Mon, 22 Jun 2015 16:22:34 +0000 (-0700) Subject: Input: imx_keypad - check for clk_prepare_enable() error X-Git-Tag: Ubuntu-snapdragon-4.4.0-1029.32~6296^2^2~11 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=e998200c1912f22cf257ae88771e56de588ee8fb;hp=84c88ef9affb34f10cb5b66b07e2d496845d1c28;p=mirror_ubuntu-zesty-kernel.git Input: imx_keypad - check for clk_prepare_enable() error clk_prepare_enable() may fail, so we should better check its return value and propagate it in the case of error. Signed-off-by: Fabio Estevam Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/keyboard/imx_keypad.c b/drivers/input/keyboard/imx_keypad.c index 2e855e6f3565..d2ea863d6a45 100644 --- a/drivers/input/keyboard/imx_keypad.c +++ b/drivers/input/keyboard/imx_keypad.c @@ -506,7 +506,9 @@ static int imx_keypad_probe(struct platform_device *pdev) input_set_drvdata(input_dev, keypad); /* Ensure that the keypad will stay dormant until opened */ - clk_prepare_enable(keypad->clk); + error = clk_prepare_enable(keypad->clk); + if (error) + return error; imx_keypad_inhibit(keypad); clk_disable_unprepare(keypad->clk);