summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorE V Ravi <evenka@codeaurora.org>2019-05-16 14:14:58 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2019-05-21 05:36:20 -0700
commit765d3befd4ec7a1461234955e14d8e4d36244142 (patch)
tree979f014adb0361b2d5a3b53bd87e2df6f200ed4a
parentf8572fa1920f1019895f60a17cb22578b8d2cac4 (diff)
msm: ais: handle the error value returned during get clock
currently only NULL pointer check is used to validate the return value from clk_get, this change to handle all the failures. This snapshot is taken from auto-kernel.lnx.4.4.c1 ported it from auto-kernel.lnx.4.4.c1 to 4.4 Change-Id: I275cb4717c675baf528e05c50058f2c6b0025011 Signed-off-by: E V Ravi <evenka@codeaurora.org>
-rw-r--r--drivers/media/platform/msm/ais/common/msm_camera_io_util.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/media/platform/msm/ais/common/msm_camera_io_util.c b/drivers/media/platform/msm/ais/common/msm_camera_io_util.c
index c6c2e0d02b65..8cee210095eb 100644
--- a/drivers/media/platform/msm/ais/common/msm_camera_io_util.c
+++ b/drivers/media/platform/msm/ais/common/msm_camera_io_util.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011-2018, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2011-2019, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -357,12 +357,13 @@ int msm_cam_clk_enable(struct device *dev, struct msm_cam_clk_info *clk_info,
}
} else {
for (i = num_clk - 1; i >= 0; i--) {
- if (clk_ptr[i] != NULL) {
+ if (!IS_ERR_OR_NULL(clk_ptr[i])) {
CDBG("%s disable %s\n", __func__,
clk_info[i].clk_name);
clk_disable(clk_ptr[i]);
clk_unprepare(clk_ptr[i]);
clk_put(clk_ptr[i]);
+ clk_ptr[i] = NULL;
}
}
}
@@ -378,10 +379,11 @@ cam_clk_set_err:
clk_put(clk_ptr[i]);
cam_clk_get_err:
for (i--; i >= 0; i--) {
- if (clk_ptr[i] != NULL) {
+ if (!IS_ERR_OR_NULL(clk_ptr[i])) {
clk_disable(clk_ptr[i]);
clk_unprepare(clk_ptr[i]);
clk_put(clk_ptr[i]);
+ clk_ptr[i] = NULL;
}
}
return rc;