Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit af3ef07a authored by Archana Sathyakumar's avatar Archana Sathyakumar
Browse files

msm-core: Fix potential NULL pointer issue



If argp is NULL, accessing argp without a NULL pointer check
results in kernel crash. Add a check before accessing the variable.

Change-Id: Ic06162911a998a9daffb36eede094ede6cecbe40
Signed-off-by: default avatarArchana Sathyakumar <asathyak@codeaurora.org>
parent dbd2b72e
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -399,13 +399,16 @@ static long msm_core_ioctl(struct file *file, unsigned int cmd,
	struct cpu_activity_info *node = NULL;
	struct sched_params __user *argp = (struct sched_params __user *)arg;
	int i, cpu = num_possible_cpus();
	int mpidr = (argp->cluster << (MAX_CORES_PER_CLUSTER *
			MAX_NUM_OF_CLUSTERS));
	int cpumask = argp->cpumask;
	int mpidr;
	int cpumask;

	if (!argp)
		return -EINVAL;

	mpidr = (argp->cluster << (MAX_CORES_PER_CLUSTER *
			MAX_NUM_OF_CLUSTERS));
	cpumask = argp->cpumask;

	switch (cmd) {
	case EA_LEAKAGE:
		ret = update_userspace_power(argp);