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

Commit dcd0a696 authored by Abir Ghosh's avatar Abir Ghosh Committed by Gerrit - the friendly Code Review server
Browse files

qbt1000: Initialize drvdata structure before usage



Fix uninitialized local variable error which might have lead to
crash

Change-Id: I3fd95cb343c3175e4190c8ebfe209399db0602a6
CRs-Fixed: 2030137
Signed-off-by: default avatarAbir Ghosh <abirg@codeaurora.org>
parent 6a395aad
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -753,13 +753,14 @@ static long qbt1000_ioctl(struct file *file, unsigned cmd, unsigned long arg)
	void __user *priv_arg = (void __user *)arg;
	struct qbt1000_drvdata *drvdata;

	drvdata = file->private_data;

	if (IS_ERR(priv_arg)) {
		dev_err(drvdata->dev, "%s: invalid user space pointer %lu\n",
			__func__, arg);
		return -EINVAL;
	}

	drvdata = file->private_data;
	pm_runtime_get_sync(drvdata->dev);
	mutex_lock(&drvdata->mutex);
	if (((drvdata->sensor_conn_type == SPI) && (!drvdata->clock_state)) ||