Commit b19e1346 authored by Dong Aisheng's avatar Dong Aisheng Committed by Chanwoo Choi
Browse files

PM / devfreq: Check get_dev_status in devfreq_update_stats



Check .get_dev_status() in devfreq_update_stats in case it's abused
when a device does not provide it.

Signed-off-by: default avatarDong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
parent 5f104f9f
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -91,6 +91,9 @@ int devfreq_update_target(struct devfreq *devfreq, unsigned long freq);

static inline int devfreq_update_stats(struct devfreq *df)
{
	if (!df->profile->get_dev_status)
		return -EINVAL;

	return df->profile->get_dev_status(df->dev.parent, &df->last_status);
}
#endif /* _GOVERNOR_H */