From: Arvind Yadav Date: Thu, 1 Jun 2017 10:47:10 +0000 (+0530) Subject: pcmcia: soc_common: Handle return value of clk_prepare_enable X-Git-Tag: v4.19~1609^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d3fdd701248290b511683ff8d348073295f07833;p=platform%2Fkernel%2Flinux-rpi.git pcmcia: soc_common: Handle return value of clk_prepare_enable clk_prepare_enable() can fail here and we must check its return value. Signed-off-by: Arvind Yadav CC: Russell King Signed-off-by: Dominik Brodowski --- diff --git a/drivers/pcmcia/soc_common.c b/drivers/pcmcia/soc_common.c index 764650e..c5f2344 100644 --- a/drivers/pcmcia/soc_common.c +++ b/drivers/pcmcia/soc_common.c @@ -191,12 +191,16 @@ static int soc_pcmcia_hw_init(struct soc_pcmcia_socket *skt) { int ret = 0, i; - clk_prepare_enable(skt->clk); + ret = clk_prepare_enable(skt->clk); + if (ret) + return ret; if (skt->ops->hw_init) { ret = skt->ops->hw_init(skt); - if (ret) + if (ret) { + clk_disable_unprepare(skt->clk); return ret; + } } for (i = 0; i < ARRAY_SIZE(skt->stat); i++) {