devfreq: update device suspended check
Update device suspended condition check in get_freq function, in some scenarios the device is in suspended and if node is null, the condition will pass and wrongly code will proceed to access the node pointer which is null, update if condition for device suspended state. Change-Id: Ia18aeaf24c788294beb30d2f9d92d0e85fe90bc6 Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
This commit is contained in:
parent
88aad58420
commit
c137a1af19
1 changed files with 4 additions and 1 deletions
|
@ -713,8 +713,11 @@ static int devfreq_bw_hwmon_get_freq(struct devfreq *df,
|
|||
{
|
||||
struct hwmon_node *node = df->data;
|
||||
|
||||
if (!node)
|
||||
return -EINVAL;
|
||||
|
||||
/* Suspend/resume sequence */
|
||||
if ((node && !node->mon_started) || df->dev_suspended) {
|
||||
if (!node->mon_started || df->dev_suspended) {
|
||||
*freq = node->resume_freq;
|
||||
*node->dev_ab = node->resume_ab;
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue