From: Arvind Yadav Date: Tue, 6 Jun 2017 09:34:46 +0000 (+0530) Subject: thermal: hisilicon: Handle return value of clk_prepare_enable X-Git-Tag: v4.4.108~7 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=69dd89a1f919df7ab2e38f6f73fca0735d620205;p=thirdparty%2Fkernel%2Fstable.git thermal: hisilicon: Handle return value of clk_prepare_enable commit 919054fdfc8adf58c5512fe9872eb53ea0f5525d upstream. clk_prepare_enable() can fail here and we must check its return value. Signed-off-by: Arvind Yadav Signed-off-by: Eduardo Valentin Signed-off-by: Kevin Wangtao Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/thermal/hisi_thermal.c b/drivers/thermal/hisi_thermal.c index 36d07295f8e3a..a56f6cac6fc5e 100644 --- a/drivers/thermal/hisi_thermal.c +++ b/drivers/thermal/hisi_thermal.c @@ -389,8 +389,11 @@ static int hisi_thermal_suspend(struct device *dev) static int hisi_thermal_resume(struct device *dev) { struct hisi_thermal_data *data = dev_get_drvdata(dev); + int ret; - clk_prepare_enable(data->clk); + ret = clk_prepare_enable(data->clk); + if (ret) + return ret; data->irq_enabled = true; hisi_thermal_enable_bind_irq_sensor(data);