Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drivers/rtc/rtc-mxc.c: check the return value from clk_prepare_enable()

clk_prepare_enable() may fail, so let's check its return value and
propagate it in the case of error.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Fabio Estevam and committed by
Linus Torvalds
1b3d2243 fbd5e754

+4 -1
+4 -1
drivers/rtc/rtc-mxc.c
··· 394 394 return PTR_ERR(pdata->clk); 395 395 } 396 396 397 - clk_prepare_enable(pdata->clk); 397 + ret = clk_prepare_enable(pdata->clk); 398 + if (ret) 399 + return ret; 400 + 398 401 rate = clk_get_rate(pdata->clk); 399 402 400 403 if (rate == 32768)