From e9293b044ce829769228a135b3417eb3e05d010c Mon Sep 17 00:00:00 2001 From: Maria Yu Date: Wed, 3 Jan 2018 22:03:29 +0800 Subject: [PATCH] devfreq: spdm: Fix for rpm creat request err ERR value or NULL may returned from msm_rpm_create_request, so correct the check as IS_ERR_OR_NULL. Change-Id: I069f3c74e5d699ce394355dda192b662ba75f6a0 Signed-off-by: Maria Yu --- drivers/devfreq/governor_spdm_bw_hyp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/devfreq/governor_spdm_bw_hyp.c b/drivers/devfreq/governor_spdm_bw_hyp.c index 5751ab624ce8..7e7e0eee7f6d 100644 --- a/drivers/devfreq/governor_spdm_bw_hyp.c +++ b/drivers/devfreq/governor_spdm_bw_hyp.c @@ -1,5 +1,5 @@ /* - *Copyright (c) 2014-2017, The Linux Foundation. All rights reserved. + *Copyright (c) 2014-2018, 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 @@ -42,7 +42,7 @@ static int enable_clocks(void) rpm_req = msm_rpm_create_request(MSM_RPM_CTX_ACTIVE_SET, SPDM_RES_TYPE, SPDM_RES_ID, 1); - if (!rpm_req) + if (IS_ERR_OR_NULL(rpm_req)) return -ENODEV; msm_rpm_add_kvp_data(rpm_req, SPDM_KEY, (const uint8_t *)&one, sizeof(int)); @@ -61,7 +61,7 @@ static int disable_clocks(void) rpm_req = msm_rpm_create_request(MSM_RPM_CTX_ACTIVE_SET, SPDM_RES_TYPE, SPDM_RES_ID, 1); - if (!rpm_req) + if (IS_ERR_OR_NULL(rpm_req)) return -ENODEV; msm_rpm_add_kvp_data(rpm_req, SPDM_KEY, (const uint8_t *)&zero, sizeof(int));