Skip to content
Snippets Groups Projects
Commit b256cd87 authored by Abir Ghosh's avatar Abir Ghosh Committed by Steve Pfetsch
Browse files

qbt1000: Initialize drvdata structure before usage


Fix uninitialized local variable error which might have lead to
crash

Bug: 35764241
Change-Id: I3fd95cb343c3175e4190c8ebfe209399db0602a6
CRs-Fixed: 2030137
Signed-off-by: default avatarAbir Ghosh <abirg@codeaurora.org>
parent 43ff88a8
Branches
Tags
No related merge requests found
......@@ -752,13 +752,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)) ||
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment