Input: tegra-kbc - handle return value of clk_prepare_enable
authorArvind Yadav <arvind.yadav.cs@gmail.com>
Thu, 31 Aug 2017 18:35:29 +0000 (11:35 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Thu, 31 Aug 2017 18:57:27 +0000 (11:57 -0700)
clk_prepare_enable() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/keyboard/tegra-kbc.c

index 0c07e1023a4693ac705acea1b26068c65c54b39f..edc1385ca00bbde87f80268ecac3c21ed9b8a9e5 100644 (file)
@@ -370,8 +370,11 @@ static int tegra_kbc_start(struct tegra_kbc *kbc)
 {
        unsigned int debounce_cnt;
        u32 val = 0;
+       int ret;
 
-       clk_prepare_enable(kbc->clk);
+       ret = clk_prepare_enable(kbc->clk);
+       if (ret)
+               return ret;
 
        /* Reset the KBC controller to clear all previous status.*/
        reset_control_assert(kbc->rst);