diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2017-02-02 12:31:31 -0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-02-02 12:31:30 -0800 |
commit | 7ac59f96422027a21739e203d3f3824650d6a9f9 (patch) | |
tree | 8cc4ffd2b272ec456e90253b9bd23b7c3324c270 | |
parent | 00b5ea23840289588a9cd12cc187d55e3c614322 (diff) | |
parent | fb77e96735189e7e3cf445880e58a83981b81d01 (diff) |
Merge "crypto: ice: Fix NULL pointer exception in ice."
-rw-r--r-- | drivers/crypto/msm/ice.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/crypto/msm/ice.c b/drivers/crypto/msm/ice.c index 027a0d0bd0b8..2788c0add14a 100644 --- a/drivers/crypto/msm/ice.c +++ b/drivers/crypto/msm/ice.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved. +/* Copyright (c) 2014-2017, 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 @@ -1608,7 +1608,18 @@ static int enable_ice_setup(struct ice_device *ice_dev) out_clocks: qcom_ice_enable_clocks(ice_dev, false); out_reg: - regulator_disable(ice_dev->reg); + if (ice_dev->is_regulator_available) { + if (qcom_ice_get_vreg(ice_dev)) { + pr_err("%s: Could not get regulator\n", __func__); + goto out; + } + ret = regulator_disable(ice_dev->reg); + if (ret) { + pr_err("%s:%pK: Could not disable regulator\n", + __func__, ice_dev); + goto out; + } + } out: return ret; } |