Change-Id: I70cb0cfd108ec165d8a863cf6c4c35ea42571b69
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
static int system_driver_prepare_update(struct resource *res)
{
- struct system_resource_data *sysdata = get_resource_privdata(res);
+ struct system_resource_data *sysdata;
const char *res_name = get_resource_name(res);
int ret;
+ sysdata = get_resource_privdata(res);
+ if (!sysdata)
+ return -EINVAL;
+
/* Get the per-cpu utilization */
memcpy(sysdata->prev_cpus, sysdata->curr_cpus,
sizeof(struct cpu_stat) * sysdata->num_possible_cpus);